-
-
Notifications
You must be signed in to change notification settings - Fork 568
Closed
Closed
Copy link
Labels
questionFurther information is requestedFurther information is requested
Description
Is your feature request related to a problem? Please describe.
I use a custom Jackson BeanSerializerModifier.
However, springdoc does not consider this customisation when inferring the Schema.
In this specific case, the SingleValueWrappingTypeSerializerModifier unwraps value-objects (annotated or interface-marked with jMolecules DDD types) containing a single "base-type".
record Email(String value) implements ValueObject {}
// vs. otherwise
record Email(@JsonValue String value) implements ValueObject {}Meaning, instead of generating a schema like this:

The schema contains a nested structure for the value object --- despite Jackson serialising the object flat

Describe the solution you'd like
- The automatically generated schema matches "somehow" what Jackson produces --- despite custom seralizer modifiers.
Describe alternatives you've considered
- For my use-case, simply adding an
@Schemawith either an example or explicitly defining the type works - Skip the custom serializer all together and always, explicitly use
@JsonValue
Additional context
- I have reproduced the issue here.
- Initially discussed here: Springdoc/Swagger integration for Single-Value Value-Objects xmolecules/jmolecules-integrations#310 (comment)
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested