Closed adamscarberry closed 2 years ago
For the swagger controllers there is generally a getOne endpoint and a getAll endpoint. The getOne endpoints usually have some sort of Id in the path. That is the location-id field you are seeing. Some of the endpoints also have a legacy implementation that calls pl/sql and returns raw results. If there is a new implementation it's usually JsonV2.
In your output I see that it's going to the old pl/sql and it thinks that the names field to the query is "*". Which tells me that the id isn't getting through to the pl/sql.
Maybe we should be checking for extra unmatched parameters and throwing an error or something
Maybe a long way of saying the parameter should be names and not location-id or name.
For some of the endpoints we've deprecated some of the older parameters or ones that were wrongly cased or typo'd. I think all those parameters are documented with a deprecated tag in the docs but it's possible I missed something. I know there was a mixup between name and names in at least one Controller so it's also possible something got ninja edited on you but in general we've just been deprecating the old parameters and supporting both. I don't think any have been intentionally broken or removed yet
The url provided doesn't have a slash after the locations portion so the parameter should be names
According to the swagger docs here, location-id is the url param to use to filter by a single location.
Both requests below will return 692 locations (the whole catalog) for LRH.
https://cwms-data.usace.army.mil/cwms-data/locations?location-id=Bluestone-Lake&office=LRH
https://cwms-data.usace.army.mil/cwms-data/locations?name=Bluestone-Lake&office=LRH
Top snippet of the response:
Using
names=Bluestone-Lake
is perhaps the previous way to filter by location? and still works.https://cwms-data.usace.army.mil/cwms-data/locations?names=Bluestone-Lake&office=LRH