-
Notifications
You must be signed in to change notification settings - Fork 5
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
Search API does not match a collection that is in the registry #239
Comments
For some additional context here, I think all
|
@jordanpadams I found this issue while looking for whether /classes/{class}/{identifier} was known to be not-implemented or known to be broken - it doesn't appear in the swagger docs and doesn't work on my local (which I was testing for an unrelated ticket) @al-niessner @tloubrieu-jpl any positive memory of this path being already implemented? |
Because it is just /products/(identifier}. Doing /classes/{class}/{identifier} is possible and only adds confusion to /products/{identifier} if the user does /classes/bundles/urn:pds:mybundle:mycollection because now you need to throw an error because the collection lidvid is not a bundle. So, /products/{identifier} should be used instead. |
@al-niessner how does this gel with the fact that (for example) |
Annoyingly, it throws an error when identifier is not a collection. It is clearer to the user than returning nothing because the identifier is not a collection. I had to put some gross blister code in the controller to check that the identifier, if found, was of the correct type to handle all those. The original code was written to do /products/{id}/references/{class} or referenced-by for references and /classes/{class}/references/{id} again with references or referenced-by. All the current endpoints are some butchering of those 4 endpoints so it uses the referencing code but just bashes up the user context. The original 4 also prevent this crazy check of is this id of that class. |
Thanks Al. Given that, @jordanpadams, what is the intended functionality here? |
@alexdunnjpl I'm not sure I am entirely following here, but if we have an identifier @tloubrieu-jpl ☝️ thoughts? |
@jordanpadams basically: The same is also probably true for the bundles equivalents. So my question was/is "Were they ever actually implemented, or was it just If I understand @al-niessner correctly, his position is that they aren't and shouldn't be implemented, and the fact that their equivalents were implemented in the deprecated version of the API is a bug rather than a feature, because they require an additional check to validate the result's collection-ness or bundle-ness (Al, is this a bad thing because such checks are hard to implement in the intended paradigm/architecture of the API? I'd have thought this was a pretty standard level of flexibility to require of an API) So the decision to be made is what is supposed to be implemented and why/why-not. |
Just to chime in here, as somebody that is new to the API, my first impression is that the API is too complex. The
With that, the user only has 4 endpoints to learn how to use. |
Your proposal is interesting @jjacob7734, I like the idea and we should discuss that further. However I would left that discussion aside for now to simplify the discussion here (we could create a different ticket). To @alexdunnjpl , I think this is my mistake to understand that /collections/ has been migrated to /classes/collections/. This is fine with me for now if it does not work and that we use /products/ instead. |
If everyone agrees, and if I did not miss anything we can close this ticket with label wontfix |
@tloubrieu-jpl my thought - pragmatism no object - is that we want these endpoints, if not because I think it's a preferable choice of functionality then because our spec for the PDS API mandates RESTful implementations, and for any endpoint returning a collection (of resources - not a PDS Collection) it's kind of a gimme that a minimal implementation will include support for "that endpoint URI path plus an identifier" which returns the single resource from that collection, having the given identifier. In practice, it sounds like there's a good reason why it may be difficult to support this - reading between the lines it seems like maybe the existing implementation architecture of the API is too rigid to cleanly support the required behaviour (hence gross blister code)? Perhaps @al-niessner can more-accurately speak to the "why" of that, otherwise if you think it's worth considering I'll dig in and try to figure that out myself. |
@alexdunnjpl I am with you on the RestFul implementation, but for now I was rather looking easy way to close tickets which are not blocking bugs. |
@alexdunnjpl @tloubrieu-jpl just for my own clarification, the endpoint definition missing here is not actually |
I am closing ticket as not a bug since we want to deprecate anyway the /classes/{class}/{identifier} end-points in the API |
Checked for duplicates
Yes - I've already checked
🐛 Describe the bug
The endpoint https://pds.nasa.gov/api/search/1/products/urn:nasa:pds:orex.ovirs:data_calibrated gave me a matching result, but the same LID in the endpoint https://pds.nasa.gov/api/search/1/classes/collections/urn:nasa:pds:orex.ovirs:data_calibrated gave me a 404 not found response.
🕵️ Expected behavior
I expected to get get a match with both endpoints.
📜 To Reproduce
🖥 Environment Info
- Queries sent to production registry deployed at https://pds.nasa.gov/api/search/1/ - Curl command on MacOSX 13.1 Ventura ...
📚 Version of Software Used
curl 7.85.0 (x86_64-apple-darwin22.0) libcurl/7.85.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.47.0
Release-Date: 2022-08-31
🩺 Test Data / Additional context
No response
🦄 Related requirements
🦄 #xyz
⚙️ Engineering Details
N/A
The text was updated successfully, but these errors were encountered: