Skip to content

Apply class-level annotations in Pickler schema derivation#5350

Open
henricook wants to merge 1 commit into
softwaremill:masterfrom
henricook:pickler-class-level-annotations
Open

Apply class-level annotations in Pickler schema derivation#5350
henricook wants to merge 1 commit into
softwaremill:masterfrom
henricook:pickler-class-level-annotations

Conversation

@henricook

Copy link
Copy Markdown

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 enrichSchema step on the top-level schema, mirroring what SchemaMagnoliaDerivation already 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 (previously ignored, with TODOs referencing them) are now enabled and pass; the rest of the suite is unchanged.

Closes #3166
Closes #3167

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
@henricook henricook marked this pull request as ready for review June 27, 2026 11:34
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.

[BUG] Missing support for @description for macro-based schema derivation [BUG] Missing support for @customise for macro-based schema derivation

1 participant