USACE / USACE/cwms-data-api

Swagger UI TS Group Schema uses camelCase

Open
#1,592 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

Describe the bug
Swagger UI shows schema on POST example as camelCase but CDA enforces kebab-case on the backend.

Expected behavior
Ensure schema matches what the backend expects. UI returns a 500 which requires you to go to the log to then realize you should have provided "office-id" and not "officeId" the schema had shown.

To Reproduce

Attempt a POST request on timeseries group with

{
  "office-id": "SWT",
  "id": "test",
  "time-series-category": {
    "office-id": "SWT",
    "id": "KEYS",
    "description": "Keystone Lake"
  },
  "description": "List of ID's ordered in columns by their attribute integer",
  "assigned-time-series": [
    {
      "officeId": "SWT",
      "timeseriesId": "KEYS.Elev.Inst.1Hour.0.Ccp-Rev",
      "attribute": 0
    }
  ]
}

Logs/Incident Identifier

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "officeId" (class cwms.cda.data.dto.AssignedTimeSeries), not marked as ignorable (5 known properties: "alias-id", "office-id", "ref-ts-id", "timeseries-id", "attribute"])
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 206] (through reference chain: cwms.cda.data.dto.TimeSeriesGroup["assigned-time-series"]->java.util.ArrayList[0]->cwms.cda.data.dto.AssignedTimeSeries["officeId"])
		at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
		at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1153)
		at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2241)
		at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1793)
		at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1771)
		at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:316)
		at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
		at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:361)
		at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:246)
		at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:30)
		at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
		at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:310)
		at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
		at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
		at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4905)
		at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3848)
		at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3816)
		at cwms.cda.formatters.json.JsonV1.parseContent(JsonV1.java:85)
		... 67 more

CDA Version (please complete the following information):
At the top of any instance of CDA you will see a version. Please provide that version.

  • Version 2026.02.18-develop

Additional context

Thought I saw a PR that would check the schema in PR to prevent things like this

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 the Swagger UI schema for the timeseries group POST and the cwms.cda.data.dto.AssignedTimeSeries entry shown in the error. Compare the generated example with the kebab-case properties accepted by the backend, including office-id and timeseries-id. Verify that the corrected schema produces a valid POST without the reported 500 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.