Skip to content

Fix recent timeseries OpenAPI schema#1725

Open
krowvin wants to merge 1 commit intodevelopfrom
fix-timeseries-recent-openapi
Open

Fix recent timeseries OpenAPI schema#1725
krowvin wants to merge 1 commit intodevelopfrom
fix-timeseries-recent-openapi

Conversation

@krowvin
Copy link
Copy Markdown
Collaborator

@krowvin krowvin commented May 8, 2026

Summary

While working with the TS recent method in cwmsjs I found an issue with the annotations.
I.e. (Note if this change is brought in this will need to be regenerated on the generator)
https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/classes/TimeSeriesApi.html#getTimeSeriesRecent.getTimeSeriesRecent-1

This fixes the OpenAPI response schema for GET /timeseries/recent.

The controller returns and formats List<RecentValue>, but the OpenAPI annotation documented the 200 JSON response as Tsv[]. That caused generated clients to map the endpoint to the wrong model and drop the useful recent-value payload fields such as id and dqu.

This updates the annotation to use RecentValue[] and adds a regression test to confirm the documented response type stays aligned with the controller behavior.

Validation

  • Added a unit test asserting TimeSeriesRecentController.handle documents the 200 response as RecentValue.

  • Attempted to run:

    .\gradlew.bat :cwms-data-api:test --tests cwms.cda.api.TimeSeriesControllerTest

  • Local validation is currently blocked on Java 21 by a pre-existing compile issue in TimeSeriesDaoImpl.java, where unqualified Record is ambiguous between org.jooq.Record and java.lang.Record.

  • The PR CI currently runs on Java 11, where that ambiguity does not occur. Asked about possibly testing CI PR for java 21 as well.

Checklist

  • AI tools used

@krowvin krowvin requested a review from MikeNeilson May 8, 2026 20:59
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.

1 participant