Skip to content

Conversation

@AndrewWestberg
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.message from a nullable String to a nullable ErrorFieldMessage sealed type, and added a custom ErrorFieldMessageSerializer to handle both string and object JSON representations.
  • Introduced ErrorFieldMessage.SimpleMessage and ErrorFieldMessage.ComplexMessage to model the two observed Eveara formats, including nested messages, success flag, and errorFields key.
  • Added ErrorFieldTest to verify parsing of standalone ErrorField, ValidateData, and ValidateAlbumResponse for both simple and complex error_fields payloads, 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.

@AndrewWestberg AndrewWestberg merged commit 26be123 into master Jan 26, 2026
8 checks passed
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.

3 participants