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
Filter out extension endpoints before validation #794
Conversation
Codecov Report
@@ Coverage Diff @@
## master #794 +/- ##
=======================================
Coverage 92.71% 92.72%
=======================================
Files 68 68
Lines 3666 3669 +3
=======================================
+ Hits 3399 3402 +3
Misses 267 267
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
optimade/validator/validator.py
Outdated
available_json_entry_endpoints = [ | ||
endp | ||
for endp in available_json_entry_endpoints | ||
if not endp.startswith("extensions/") |
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 there are custom endpoints not under extensions/
, then they are still not accounted for.
I think we should instead turn this upside down and only test a specific set of endpoints and leave everything else alone? Or do we have requirements for custom endpoints in the specification? Stuff like what they have to return and such?
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.
The only constraint is that they have to be served from extensions/<type>
, so anything that does not start with extensions/
is fair game (this obviously relates to #793 (comment)).
I think your suggestion makes sense to only validate {"structures", "references", "calculations"}
(where "/calculations"
will only be checked as a valid entry listing endpoint).
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.
I believe we at some point agreed in the specification that providers can create custom endpoints both at the root as well as under , hence my idea to instead focus on the entry endpoints we know about, i.e., the ones you list here.extensions/
Edit: It seems someone (perhaps myself) may have trumped through that they have to be served under extensions/
, but I remember there was a discussion with @rartino and @merkys (as well as yourself) about this. But never mind. If we just instead focus on the endpoints we know of, i.e., again the ones you list here, then we can check if they are listed or available and only validate them.
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.
Yup, imagine this is something that will be discussed again this year; let's just fix this as suggested for now.
Closes #793.