HydrologicEngineeringCenter / HydrologicEngineeringCenter/cwms-python
cwms/projects/projects.py::get_project uses the wrong API version for retrieval
- Dominant language
- Python
- Stars
- 16
- Forks
- 11
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 8
Description
projects.py uses the default API version for retrieval, and causes the following error:
{"message":"Formatting error:No Format for this content-type and data-type : (application/json;version=2, cwms.cda.data.dto.project.Project)", "incidentIdentifier":"bf796eca-d668-4e14-923c-db78845580c0", "source":"Parser","details":{}}
After looking at CDA, it's expecting API version 1
https://github.com/USACE/cwms-data-api/blob/develop/cwms-data-api/src/main/java/cwms/cda/api/ProjectController.java#L159
https://github.com/USACE/cwms-data-api/blob/develop/cwms-data-api/src/main/java/cwms/cda/api/ProjectController.java#L183-L187
We can either update CDA to support a new version, or update projects.py to use the correct version.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in cwms/projects/projects.py and inspect the project retrieval path, then compare its API version with the ProjectController references in the linked cwms-data-api code. Review pull request #319 before changing anything; done means project retrieval no longer requests the unsupported version and the reported formatting error is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100