fix: correctly parse eveara errorfield#717
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Eveara distribution models so that error_fields.message can be parsed correctly whether Eveara sends it as a simple string or as a nested object, and adds tests to lock in the expected behavior across the relevant response types.
Changes:
- Changed
ErrorField.messagefrom a nullableStringto a nullableErrorFieldMessagesealed type, and added a customErrorFieldMessageSerializerto handle both string and object JSON representations. - Introduced
ErrorFieldMessage.SimpleMessageandErrorFieldMessage.ComplexMessageto model the two observed Eveara formats, including nested messages, success flag, anderrorFieldskey. - Added
ErrorFieldTestto verify parsing of standaloneErrorField,ValidateData, andValidateAlbumResponsefor both simple and complexerror_fieldspayloads, including mixed lists and null/missing messages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
newm-server/src/main/kotlin/io/newm/server/features/distribution/model/ErrorField.kt |
Extends ErrorField to use a sealed ErrorFieldMessage with a custom JSON serializer to support both string and complex-object message formats from Eveara. |
newm-server/src/test/kotlin/io/newm/server/features/distribution/model/ErrorFieldTest.kt |
Adds unit tests covering decoding of simple, complex, mixed, and null error_fields in ErrorField, ValidateData, and ValidateAlbumResponse. |
wlara
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.