Skip to content

Turbine Changes Require List POST#131

Merged
krowvin merged 2 commits intomainfrom
correct-api-type-check
Feb 26, 2025
Merged

Turbine Changes Require List POST#131
krowvin merged 2 commits intomainfrom
correct-api-type-check

Conversation

@krowvin
Copy link
Collaborator

@krowvin krowvin commented Feb 26, 2025

The endpoint
/swt-data/projects/{office}/{name}/turbine-changes

Requires a List to store.

We attempted to store using a dictionary/Object and got a serialization error.

Error :

Cannot deserialize value of type `java.util.ArrayList<cwms.cda.data.dto.location.kind.TurbineChange>` from Object value (token `JsonToken.START_OBJECT`)

Suggesting it is trying to use an Array but an Object was provided

In this PR I update the post and patch in the API methods to allow for a List to be provided.

I confirmed this works by manually editing the library on @AndySWT computer and we successfully saved a turbine change.

I did consider putting JSON as the type check, but that appears to be of type [dict, Any] and could cause issues.

@sonarqubecloud
Copy link

@krowvin krowvin merged commit 53ec065 into main Feb 26, 2025
8 checks passed
@krowvin krowvin deleted the correct-api-type-check branch February 26, 2025 21:46
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.

2 participants