Commit 4902c23
authored
Fix recent timeseries OpenAPI schema (#1725)
## 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
- [x] AI tools used1 parent 99079d5 commit 4902c23
2 files changed
Lines changed: 20 additions & 3 deletions
File tree
- cwms-data-api/src
- main/java/cwms/cda/api
- test/java/cwms/cda/api
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
279 | 285 | | |
280 | 286 | | |
281 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
282 | 300 | | |
283 | | - | |
| 301 | + | |
0 commit comments