USACE / USACE/cwms-data-api

Incorrect swagger output for timeseries values

Open Beginner friendly
#905 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

approved-W192HQ23F0232-task4 documentation planned priority:low
Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

Originally from https://github.com/HydrologicEngineeringCenter/cwms-data-api-client-javascript/issues/3 and reported by @jbkolze

https://github.com/HydrologicEngineeringCenter/cwms-data-api-client-javascript/blob/4e1c0c8066986fb55882bdddb1fd978b6021c836/cwms-swagger.json#L9308-L9334

The "values" key in the TimeSeries return object is defined in the OpenAPI as an array of arrays of objects. The actual returned object is just an array of arrays of numbers (with no actual definition/structure). This is causing typing issues when using the cwmsjs library with TypeScript.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cwms-swagger.json at lines 9308-9334 and inspect the TimeSeries return object's values schema. Compare that definition with the reported response shape in the issue: an array of arrays of numbers. Update the OpenAPI definition so generated TypeScript typings match the actual response, then verify the resulting schema or client types.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.