flowup / api-client-generator

Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
MIT License
115 stars 21 forks source link

support for embedded `allOf` property models #80

Closed MumblesNZ closed 5 years ago

MumblesNZ commented 5 years ago

Hey,

Is it possible to support embedded property models. Like:

DetectIntentDto:
    type: object
    properties:
      queryInput:
        title: QueryInputDto
        allOf:
          - $ref: '#/definitions/QueryInputDto'
          - description: The query input

It looks like this is related to #53 but at the property level.

Thanks.

vmasek commented 5 years ago

Thanks for the report.

Could you please also share what is the QueryInputDto definition?

I'll try to have a look at what can be done with this.

MumblesNZ commented 5 years ago

Hey vmasek, sure:

QueryInputDto:
    type: object
    properties:
      text:
        title: TextInputDto
        allOf:
          - $ref: '#/definitions/TextInputDto'
          - description: The natural language text to be processed
      audioConfig:
        title: InputAudioConfigDto
        allOf:
          - $ref: '#/definitions/InputAudioConfigDto'
          - description: Instructs the speech recognizer how to process the speech audio
vmasek commented 5 years ago

There is one small problem in your definition and it is that you are not listing the description as part of the allOf's properties but as a separate "type"

It should look like this (remove the dash - before the description keyword)

QueryInputDto:
  type: object
  properties:
    text:
      title: TextInputDto
      allOf:
        - $ref: '#/definitions/TextInputDto'
          description: The natural language text to be processed
    audioConfig:
      title: InputAudioConfigDto
      allOf:
        - $ref: '#/definitions/InputAudioConfigDto'
          description: Instructs the speech recognizer how to process the speech audio

Otherwise, this should be resolved with the closest release