Skip to content

Conversation

@jwilkinson87
Copy link
Contributor

This pull request refactors and improves the resource hydration logic in the FormSubmissionVersion class, moving from a custom mapping approach to using Jasminb's ResourceConverter for JSON:API resource handling. It also removes legacy envelope/data classes, simplifies resource lookup, and updates related tests and models.

Refactor and improvement of resource hydration:

  • Replaces custom resource mapping logic with Jasminb's ResourceConverter, enabling more robust and extensible JSON:API resource hydration in FormSubmissionVersion. This includes new helper methods for converter configuration and raw resource lookup.
  • Removes legacy JsonApiEnvelope and JsonApiResourceData classes, as hydration now relies on Jasminb's converter and registered types.

API and test updates:

  • Updates the public hydration API: introduces hydrateResourceById(id, clazz) as the primary method, and updates tests to use this new method instead of the old autoHydrateByIdAs. [1] [2]
  • Improves type registry access with a synchronized method to retrieve all registered classes for converter configuration.

Minor improvements:

  • Adds explicit @JsonProperty("id") annotation to the id field in the Image model for consistency.
  • Minor test renaming for clarity.

@github-actions
Copy link

There is a problem with the Gemini CLI PR review. Please check the action logs for details.

@jwilkinson87 jwilkinson87 merged commit ff7dd3d into main Oct 27, 2025
2 of 3 checks passed
@jwilkinson87 jwilkinson87 deleted the fix/hydrate-resources-using-jsonapi-library branch October 27, 2025 13:58
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