public record Car(String model, @JsonUnwrapped @Schema(implementation=ResourcePath.class) Resource resource, boolean selected) {
}
public abstract class Resource {
}
public abstract class ResourcePath extend Resource {
public String resourcePath;
public String resourceType;
}
Resource is an abstract class, and does not contain all the fields present in ResourcePath. However, Jackson picks up all the fields and still unwrap them with @JsonUnwrapped.
The moment I specify an implementation in @Schema, resource stop being unwrapped in the openapi.yaml.
Hi, I have an object like
Resource
is an abstract class, and does not contain all the fields present inResourcePath
. However, Jackson picks up all the fields and still unwrap them with@JsonUnwrapped
.The moment I specify an
implementation
in@Schema
,resource
stop being unwrapped in theopenapi.yaml
.Expected
Result