Skip to content

fix: align endpoint data formats with production Swagger - #319

Open
krowvin wants to merge 3 commits into
mainfrom
fix/endpoint-media-versions
Open

fix: align endpoint data formats with production Swagger#319
krowvin wants to merge 3 commits into
mainfrom
fix/endpoint-media-versions

Conversation

@krowvin

@krowvin krowvin commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Several endpoint wrappers send JSON v2 to operations that accept unversioned JSON, while BLOB creation and CLOB writes send unversioned JSON where Swagger requires v2. For example, the live profile-list GET returns HTTP 406 with the existing v2 header and HTTP 200 with the corrected header.

  • Correct 28 methods across outlets, project locks, profiles, location/level writes, BLOB/CLOB writes, pump accounting, and user-role POST/DELETE.
  • Clarify that api_version selects a data representation, not a CDA release. Preserve the existing unversioned JSON aliases and supported v2/XML methods.
  • Audit 146 operations against the production Swagger spec, release 2026.05.12-i, and add 34 wire-header regression checks.

Validation: the new checks produce 28 failures on unchanged main; all 132 mock/doctest tests pass after the fix. Strict mypy, Black, isort, and diff checks pass. Live validation was read-only; authenticated write behavior is covered by prepared-request tests, not production writes.

curl -H 'Accept: application/json' 'https://cwms-data.usace.army.mil/cwms-data/timeseries/profile?office-mask=SPK&location-mask=TEST'

The existing project retrieval fix is preserved and now has a header regression test. The additional header tests support the coverage work in #257; this PR does not complete the broader integration-test coverage request.

@krowvin
krowvin requested a review from msweier September 11, 2026 04:29
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cwms/projects/projects.py::get_project uses the wrong API version for retrieval Description and usage of version is incorrect

1 participant