Skip to content

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

@KtorZ

Description

@KtorZ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions