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
openapi: 3.0.0 info: "Discount Amount" paths: components: schemas: DiscountAmount: type: object x-abstract: true properties: discountType: type: string ProductAnnualDiscountSettings: allOf: - $ref: '#/components/schemas/DiscountAmount' - type: object properties: amount: type: number type: $ref: "#/components/schemas/DiscountType" enabled: type: boolean default: false ECPAnnualDiscountSettings: allOf: - $ref: '#/components/schemas/DiscountAmount' - type: object properties: amount: type: number type: $ref: "#/components/schemas/DiscountType" enabled: type: boolean default: false DiscountType: type: string enum: - PERCENT - FLAT
Generates
data class DiscountAmount( @param:JsonProperty("discountType") @get:JsonProperty("discountType") val discountType: String? = null )
and
data class ProductAnnualDiscountSettings( @param:JsonProperty("discountType") @get:JsonProperty("discountType") val discountType: String? = null, @param:JsonProperty("amount") @get:JsonProperty("amount") val amount: BigDecimal? = null, @param:JsonProperty("type") @get:JsonProperty("type") val type: DiscountType? = null, @param:JsonProperty("enabled") @get:JsonProperty("enabled") @get:NotNull val enabled: Boolean = false )
Please note that DiscountAmount is not abstract and that ProductAnnualDiscountSettings doesn't inherit from DiscountAmount
DiscountAmount
ProductAnnualDiscountSettings
Am I doing something wrong or abstract types are not supported?
The text was updated successfully, but these errors were encountered:
x-abstract is, so far, not supported by Fabrikt. Is this what you are trying to achieve? https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/ https://github.com/cjbooms/fabrikt/blob/master/src/test/resources/examples/polymorphicModels/api.yaml
x-abstract
Sorry, something went wrong.
If you want it to be polymorphic, you'll need to add a discriminator declaration in DiscountAmount
No branches or pull requests
Generates
and
Please note that
DiscountAmount
is not abstract and thatProductAnnualDiscountSettings
doesn't inherit fromDiscountAmount
Am I doing something wrong or abstract types are not supported?
The text was updated successfully, but these errors were encountered: