We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have:
public class DonationFormResponse { ... @Schema( description = "The form layout.", oneOf = { ClassicFormLayout.class, AdaptiveFormLayout.class } ) private FormLayout formLayout; ... } @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "layout_type") @JsonSubTypes({ @JsonSubTypes.Type(value = ClassicFormLayout.class), @JsonSubTypes.Type(value = AdaptiveFormLayout.class) }) @Schema(description = "The form layout.") public interface FormLayout { ... } @Schema(allOf = FormLayout.class) public class AdaptiveFormLayout implements FormLayout { ... } @Schema(allOf = FormLayout.class) public class ClassicFormLayout implements FormLayout { ... }
The JSON generated has:
"DonationFormResponse" : { ... "form_layout" : { "oneOf" : [ { "$ref" : "#/components/schemas/AdaptiveFormLayout" }, { "$ref" : "#/components/schemas/ClassicFormLayout" } ] }, ... } ... "AdaptiveFormLayout" : { "type" : "object", "allOf" : [ { "$ref" : "#/components/schemas/FormLayout" }, { "type" : "object", "properties" : { "cards" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/Card" } } } } ] }, ... "ClassicFormLayout" : { "type" : "object", "allOf" : [ { "$ref" : "#/components/schemas/FormLayout" } ] },
But there is no definition for FormLayout so "$ref" : "#/components/schemas/FormLayout" results in a validation error.
FormLayout
"$ref" : "#/components/schemas/FormLayout"
The text was updated successfully, but these errors were encountered:
I'm using io.swagger.core.v3:swagger-annotations:2.2.21.
io.swagger.core.v3:swagger-annotations:2.2.21
Sorry, something went wrong.
No branches or pull requests
I have:
The JSON generated has:
But there is no definition for
FormLayout
so"$ref" : "#/components/schemas/FormLayout"
results in a validation error.The text was updated successfully, but these errors were encountered: