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

support for embedded models #53

Closed
rysavyvladan opened this issue Jun 6, 2018 · 1 comment
Closed

support for embedded models #53

rysavyvladan opened this issue Jun 6, 2018 · 1 comment
Assignees
Labels
enhancement Request for a change or improvement of existing functionality
Milestone

Comments

@rysavyvladan
Copy link

It would be cool if the API client could generate also embedded models with tag allOf, because now is ignoring this field.

example:

definitions:
    model:
      type: "object"
      properties:
        id:
          type: "string"
        created:
          type: "integer"
        updated:
          type: "integer"
        deleted:
          type: "integer"
    customer:
      type: "object"
      allOf:
      - $ref: "#/definitions/model"
      properties:
        name:
          type: "string"
        address:
          type: "string"
@vmasek vmasek added the enhancement Request for a change or improvement of existing functionality label Jun 6, 2018
@vmasek vmasek self-assigned this Jun 6, 2018
@vmasek
Copy link
Member

vmasek commented Jun 7, 2018

We should be able to cover the allOf the way it's described in docs

So the definitions like you proposed and this would use interface extend

  Dog:
    allOf:
      - $ref: '#/components/schemas/Pet'
      - type: object
        # all other properties specific to a `Dog`
        properties:
          bark:
            type: boolean
          breed:
            type: string
  Pet:
    type: object
    properties:
      pet_type:
        type: string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for a change or improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants