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

Discriminator field with explicit mapping does not generate wrapper type #17

Open
udoprog opened this issue Aug 20, 2018 · 0 comments
Open
Labels
bug Something isn't working

Comments

@udoprog
Copy link

udoprog commented Aug 20, 2018

On openapi-eller 0.3.1, the following:

---
openapi: 3.0.0
info: {}
servers:
  - url: "http://example.com"
paths:
  /tagged:
    get:
      operationId: get_tagged
      description: Endpoint to retrieve a single tagged interface.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tagged"
components:
  schemas:
    Tagged:
      oneOf:
        - $ref: "#/components/schemas/TaggedFoo"
      discriminator:
        propertyName: type
        mapping:
          foo: "#/components/schemas/TaggedFoo"
    TaggedFoo:
      type: object
      required:
        - type
      properties:
        type:
          type: string

Results in the following warning:

warn: Found unhandled entity 'components.schema.Tagged'

And a Tagged type does not seem to be generated.

@udoprog udoprog changed the title Discriminator field with explicit mapping does not seem to work as intended Discriminator field with explicit mapping does not generate wrapper type Aug 20, 2018
@zbrox zbrox added the bug Something isn't working label Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants