Apply class-level annotations in Pickler schema derivation#5350
Open
henricook wants to merge 1 commit into
Open
Apply class-level annotations in Pickler schema derivation#5350henricook wants to merge 1 commit into
henricook wants to merge 1 commit into
Conversation
The macro-based Pickler schema derivation read a case class's class-level annotations only to compute the schema name, and never applied them to the derived product schema. As a result @description, @customise and the other already-supported annotations had no effect when placed on a class, working only on fields. Run the existing enrichSchema step over the class-level annotations on the top-level schema, mirroring what SchemaMagnoliaDerivation already does for the magnolia-based path. No new annotation handling is added. The two tests pinned to these issues in SchemaDerivationTest, previously ignored, are now enabled and pass. Closes softwaremill#3166 Closes softwaremill#3167
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.
The macro-based Pickler schema derivation (
json/pickler) read a case class's class-level annotations only to derive its schema name, but never applied them to the product schema itself. So@description,@customise, and the other already-supported annotations had no effect when placed on a class, even though they worked fine on fields.This wires the class-level annotations through the existing
enrichSchemastep on the top-level schema, mirroring whatSchemaMagnoliaDerivationalready does for the magnolia-based path. No new annotation handling is added; it just applies the annotations that derivation already understands at the class level too.The two tests that were pinned to these issues in
SchemaDerivationTest(previouslyignored, with TODOs referencing them) are now enabled and pass; the rest of the suite is unchanged.Closes #3166
Closes #3167