Skip to content

Initial migration away from JAXB annotations#1807

Open
jeandersonbc wants to merge 8 commits intomainfrom
initial-migration-jaxb
Open

Initial migration away from JAXB annotations#1807
jeandersonbc wants to merge 8 commits intomainfrom
initial-migration-jaxb

Conversation

@jeandersonbc
Copy link
Copy Markdown
Contributor

Description
Since the underlying serializer relies on Gson lib, we are unable to use directly Jackson annotations since they don't work as expected. This was verified via test coverage. Furthermore, the required=true validation was never enforced (see AbortRequestTest tests).

Tested scenarios

  • Serialization/Deserialization from external file
  • Missing required fields (that are not enforced in practice)

Since the underlying serializer relies on Gson lib, we are unable to use directly Jackson
annotations since they don't work as expected. This was verified via test coverage.
Furthermore, the `required=true` validation was never enforced (see AbortRequestTest tests)
@jeandersonbc jeandersonbc self-assigned this Mar 27, 2026
@jeandersonbc jeandersonbc requested review from a team as code owners March 27, 2026 09:23
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates several Nexo model classes, including AbortRequest, DisplayRequest, LoginRequest, and MessageHeader, from JAXB XML annotations to GSON @SerializedName annotations. The changes also involve removing JAXB-specific metadata and adding unit tests to verify that serialization and deserialization remain functional even when fields previously marked as required are missing from the JSON payload. I have no feedback to provide.

@gcatanese gcatanese self-requested a review March 27, 2026 10:05
@thomas-cools
Copy link
Copy Markdown

@jeandersonbc is my understanding correct that we were using the jaxb annotation with GSON as the serializer / deserializer, so there is no actual change in behavior other than using GSON annotations?

tests should have failed on missing required fields
@jeandersonbc
Copy link
Copy Markdown
Contributor Author

@jeandersonbc is my understanding correct that we were using the jaxb annotation with GSON as the serializer / deserializer, so there is no actual change in behavior other than using GSON annotations?

Correct @thomas-cools (cc @gcatanese)! I also pushed this test that verifies how GSON handles the JAXB annotations. The target class (EventNotification) has not been migrated and has some required=true fields. If those checks were really enforced, EventNotificationTest would have failed.

I'm going to proceed to JAXB -> Gson annontations as part of the original task.

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