Skip to content
New issue

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

x-extendedDiscriminator doesn't seem to be applied #217

Closed
KtorZ opened this issue Mar 1, 2017 · 1 comment
Closed

x-extendedDiscriminator doesn't seem to be applied #217

KtorZ opened this issue Mar 1, 2017 · 1 comment

Comments

@KtorZ
Copy link

KtorZ commented Mar 1, 2017

I am trying to use this feature and I am having doubt understanding correctly what it does.

I expect the following snippet to be rendered with a drop-down having names "cash" and "paypal" (from the enum) instead of the definition's key "CashPayment", "PayPalPayment".

I get the following result though, on a fresh bower install of the 1.10.2 (which is the same I would get using simply 'discriminator'):

screenshot from 2017-03-01 14-58-22

I am misunderstanding the feature or is there a bug?

swagger: "2.0"
info:
  description: ReDoc
  title: title
  version: "2.0.0"
host: github.com
basePath: "/"

paths:
  "/payment":
    post:
      summary: Create
      parameters:
        - name: body
          in: body
          schema:
            $ref: "#/definitions/Payment"
      responses:
        201:
          schema:
            $ref: "#/definitions/Payment"

definitions:
  Payment:
    x-extendedDiscriminator: type
    type: object
    required:
      - type
    properties:
      type:
        type: string
      name:
        type: string

  CashPayment:
    allOf:
      - $ref: "#/definitions/Payment"
      - properties:
          type:
            type: string
            enum:
              - cash
          currency:
            type: string

  PayPalPayment:
    allOf:
      - $ref: "#/definitions/Payment"
      - properties:
          type:
            type: string
            enum:
              - paypal
          userEmail:
            type: string

Thanks.

@RomanHotsiy
Copy link
Member

@KtorZ nice catch!
This is a bug. Will be fixed for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants