You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Edit: Tell me If i'm wrong but it seems really to be a bug of swagger-core. I have resolved it locally and will create an PR on their side.
Describe the bug
When a Type is annotated with @JsonUnwrapped and the unwrapped class does have required properties they won't be mapped to the unwrapping Schema.
At first I thought this might be a bug of swagger-core but since Springfox does handle that correctly I think it belongs here?
Can confirm this. The generator currently contains a bug that does not copy required properties when using @JsonUnwrapped.
In addition, I would like to ask if it is possible to make the ModelResolver#handleUnwrapped method protected, so it can be overriden in custom model resolver.
Currently there is an issue with using custom JacksonAnnotationIntrospector that alters the properties, because the current implementaion of handleUnwrapped ignores custom introspectors. For instance, if our custom introspector capitalize the property when the @JsonUnwrapped(prefix = "prefix"), the property in the API is not capitalized.
*Edit: Tell me If i'm wrong but it seems really to be a bug of
swagger-core
. I have resolved it locally and will create an PR on their side.Describe the bug
When a Type is annotated with
@JsonUnwrapped
and the unwrapped class does have required properties they won't be mapped to the unwrapping Schema.At first I thought this might be a bug of swagger-core but since Springfox does handle that correctly I think it belongs here?
To Reproduce
As usual I've updated my repository: https://github.com/tobi6112/springdoc-issue-demo
For reference here is it also as code example:
application.properties
springdoc.remove-broken-reference-definitions=false
Bar
Foo
FooController
Expected behavior
Actual behavior
Additional Context
I personally have this problem with
org.springframework.hateoas.EntityModel
since it Unwraps the content.The text was updated successfully, but these errors were encountered: