feat: implement the ability to hydrate resources in a form submission… #17
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.
This pull request introduces a new mechanism for handling arbitrary JSON:API resource types in form submission versions. It adds a central registry for mapping resource types to Kotlin classes, enables automatic hydration of resources from raw envelopes, and provides comprehensive test coverage for these features.
Resource type registration and mapping
ResourceTypeRegistrysingleton to centrally register mappings from JSON:API resource types (e.g.,"images","operations") to Kotlin classes. This registry is initialized automatically in theApiclass and in test setups. [1] [2] [3]Resource hydration and lookup
FormSubmissionVersionmodel to support storing raw resource envelopes and added methods to:Testing and validation
FormSubmissionVersionResourcesTestto validate that resources in a submission version can be auto-hydrated to their respective classes (e.g.,Image,Operation) using the registry and envelope logic.