NASA-PDS / pds-api

PDS web APIs specifications and user's manual
http://nasa-pds.github.io/pds-api
Other
5 stars 3 forks source link

pds api not able to search using URL parameters #130

Closed gxtchen closed 2 years ago

gxtchen commented 3 years ago

🐛 Describe the bug identified during I&T

When I search using the command: curl -X GET --header 'Accept: application/json' 'https://pds-gamma.jpl.nasa.gov/api/products/urn%3Anasa%3Apds%3Ainsight_documents'

The Api returns the correct result. But when I try to use the ? search: curl -X GET --header 'Accept: application/json' 'https://pds-gamma.jpl.nasa.gov/api/products?limit=100&q=lid%20eq%20urn%3Anasa%3Apds%3Ainsight_documents&only-summary=false'

API returns 404, no content.

🥼 Related Test Case(s)

https://github.com/NASA-PDS/registry-api/issues/462

🖥 System Info


🦄 Related requirements

⚙️ Engineering Details

jordanpadams commented 3 years ago

@tloubrieu-jpl here is the corresponding ticket from I&T

tloubrieu-jpl commented 3 years ago

@gxtchen I was able to make that request work:

curl --location --request GET 'http://pds-gamma.jpl.nasa.gov/api/products?q=lid eq "urn:nasa:pds:insight_documents"&limit=100&only-summary=False'

I think this is equivalent to the one which you tested but did not work. I think the reason why it did not work is the quote missing around the lid url value. Did you get this request from a documentation that we should update.

jordanpadams commented 3 years ago

@tloubrieu-jpl should we update the API to support without quotes? this seems a little too rigid and may cause some heartburn for users?

tloubrieu-jpl commented 2 years ago

@jordanpadams , @al-niessner spent a some time to make the query handle values without quote and then, @tdddblog made some change in August which led to not supporting the values without quotes. I would say we should wait bit before supporting values without quotes again, but the best might be to discuss that during a breakout session.

jordanpadams commented 2 years ago

@tloubrieu-jpl copy. So do all values needed to be enclosed in quotes or just strings? Either way, I think what I am getting at here is we should at least document when you need quotes. And then we can reevaluate later.

tloubrieu-jpl commented 2 years ago

@jordanpadams Perfect, I created a ticket for the documentation of the API query: https://github.com/NASA-PDS/pds-api/issues/137