NCATSTranslator / reasoner-validator

Validation of Translator OpenAPI (TRAPI) messages both to TRAPI and Biolink Model standards. See https://ncatstranslator.github.io/reasoner-validator/
Other
2 stars 4 forks source link

Allow the user to specify a local schema #81

Closed edeutsch closed 1 year ago

edeutsch commented 1 year ago

It would be very useful to allow the user to specify a local schema file. The pull-automatically-from-GitHub is a fine idea, and good for many users/use cases, but has some drawbacks:

1) If you invoke the validator "too often", GitHub will lock you out for a while. Their API only allows N calls per hour or something, and if you exceed that while testing, you have to wait.

2) It makes it very awkward to test schema fixes. I am struggling with a suspected problem in TRAPI 1.4.0-beta4, and it would be very nice to be able to validate against a local yaml file that I can tweak to make sure I have the fix correct before submitting a PR to the TRAPI repo.

I'm envisioning this:

validator = TRAPIResponseValidator(trapi_schema='./TranslatorReasonerAPI_experimental.yaml', biolink_version="3.2.1")
RichardBruskiewich commented 1 year ago

@edeutsch, as I noted on Slack, I'd be interested in simply overloading (and documenting revisions to) the existing trapi_version string parameter found throughout the code base, to also accept a YAML file name or path, that is,

validator = TRAPIResponseValidator(trapi_version='./TranslatorReasonerAPI_experimental.yaml', biolink_version="3.2.1")

Although potentially slightly confusing, it may be actually simple to implement without too much extra overhead.

edeutsch commented 1 year ago

sure, that's fine with me

RichardBruskiewich commented 1 year ago

Implemented in release v3.5.4