-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'validate_unversioned_path' option, which is false by default #53
Conversation
f3b667e
to
51ff94e
Compare
51ff94e
to
de1e429
Compare
Your call @CasperWA whether you want to keep the current behaviour ("fully" validating the optional unversioned endpoint) as the default; I think it makes sense to disable it by default and handle the versions endpoint through my validator PR at Materials-Consortia/optimade-python-tools#665. |
I think you're right about this. By default only validate the required minimum and then everything else can be added on with boolean options. Yeah. |
Maybe it would be nice if the validator could separately report MUST and SHOULD-level violations? (And, formally, anything with 0 MUST validations "validates"). But serving the API on the unversioned endpoint is just on MAY level, so IMO not serving anything there should pass the validation without remarks. Nevertheless, IF something is served there, it would be useful to validate that it fulfills the specification. (But also note that there are options to HTTP-forward requests to unversioned endpoints - those need to also pass validation - I plan to add them to our implementation shortly...). |
Although it isn't quite so clear from the output, this should (lowercase) be what the validator is doing already, with the caveat that SHOULD-level violations get lumped in with the "optional" (again lowercase) tests. Of course, there might still be leftover bits that validate too harshly, but in terms of accommodating SHOULD when validating data and models there shouldn't be any problems.
👍 The issue here is that unversioned endpoints have a slightly different specification (i.e. necessity of
I'm pretty sure the requests library follows some number of redirects by default, so this shouldn't cause a problem. Please let me know if it does... |
FYI, I have written the README expecting there to be a v2.3.0 release immediately after this PR. |
No need. This will be updated by the publishing workflow (via the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to keep the premature version change, no worries. The invoke
task shouldn't care. However, it (might) assume that it can always git commit
...
Edit: Ah, you just reverted it. Never mind :)
Co-authored-by: Casper Welzel Andersen <43357585+CasperWA@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers @ml-evs ! 🎉
Closes #52.
Problems with this: no way to validate an implementation that only hosts the versions endpoint at its unversioned URL. This should probably be fixed upstream in the validator, at which point we can change the default value of this new setting to
True
.