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
{{ message }}
Repository navigation
Discriminator values are generated using the name of referenced types instead of the actual property value #2149
@openapi-ts-bot You can define mapping under discriminator, the mapping will be used as the discriminator values in the generated types. Read about in the link in the comment above
ConfirmationData:
description: "Information required to initiate the selected payment confirmation scenario by the user. More about confirmation scenarios: https://yookassa.ru/developers/payment-acceptance/getting-started/payment-process#user-confirmation"type: "object"properties:
type:
$ref: "#/components/schemas/ConfirmationDataType"locale:
$ref: "#/components/schemas/Locale"discriminator:
propertyName: "type"mapping:
redirect: "#/components/schemas/ConfirmationDataRedirect"external: "#/components/schemas/ConfirmationDataExternal"qr: "#/components/schemas/ConfirmationDataQr"embedded: "#/components/schemas/ConfirmationDataEmbedded"mobile_application: "#/components/schemas/ConfirmationDataMobileApplication"required:
- "type"
....ConfirmationDataType:
description: "Type of payment confirmation scenario by the user. Possible values: redirect - redirecting the user to a ready-made YooMoney page or a partner's page; external - waiting for the user to confirm the payment independently; qr - generating a QR and displaying it on the payment page so that the user can confirm the payment; embedded - displaying the YooMoney payment widget; mobile_application - redirecting the user to the partner's payment app."type: "string"enum:
- "redirect"
- "external"
- "qr"
- "embedded"
- "mobile_application"
....ConfirmationDataExternal:
type: "object"allOf:
- $ref: "#/components/schemas/ConfirmationData"
- type: "object"
Activity
fluctus commentedon Feb 12, 2025
+1
@thirteenthstep It does not happen when using mapping, but discriminator mapping is not supported when validating with
ajv.openint-bot commentedon Feb 13, 2025
just ran into this also @fluctus what do you mean when using
mapping? Do you have a workaround?fluctus commentedon Feb 13, 2025
@thirteenthstep The current implementation seems to match what is written in swagger.io about discriminator without mapping:
https://swagger.io/docs/specification/v3_0/data-models/inheritance-and-polymorphism/
fluctus commentedon Feb 13, 2025
@openapi-ts-bot You can define mapping under discriminator, the mapping will be used as the discriminator values in the generated types. Read about in the link in the comment above
alex-eri commentedon Apr 16, 2026
Same issue
Generated type is
neverexpected
schema