openapi-contrib / openapi3-generator

Use your API OpenAPI 3 definition to generate code, documentation, and literally anything you need.
Apache License 2.0
89 stars 27 forks source link

how to resolve $ref references #15

Closed FrancoConci closed 5 years ago

FrancoConci commented 5 years ago

I have the following OpenAPI3 section:

arrayProperty:
          type: array
          items:
            $ref: '#/components/schemas/ArrayItem'

I can get the "content" of the property items with the following Handlebar

{{#each property.items as |item itemName|}}
  {{itemName}} {{item}}
{{/each}}

with the following output:

items: 
    type string
    summaryAsHTML 
    descriptionAsHTML 
    generatedExample string

How can I resolve this reference? I'd like to access the properties of the ArrayItem and not the properties of the $ref object itself. Any hint would be greatly appreciated.

FrancoConci commented 5 years ago

I have the following OpenAPI3 section:

arrayProperty:
          type: array
          items:
            $ref: '#/components/schemas/ArrayItem'

I can get the "content" of the property items with the following Handlebar

{{#each property.items as |item itemName|}}
  {{itemName}} {{item}}
{{/each}}

with the following output:

items: 
    type string
    summaryAsHTML 
    descriptionAsHTML 
    generatedExample string

How can I resolve this reference? I'd like to access the properties of the ArrayItem and not the properties of the $ref object itself. Any hint would be greatly appreciated.

I've managed to find a workaround by splliting all referenced specs into single files.