Skip to content

Turbine Changes Require List POST #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2025
Merged

Turbine Changes Require List POST #131

merged 2 commits into from
Feb 26, 2025

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.

@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