yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator
MIT License
627 stars 147 forks source link

Fix nested schemas in subclasses thinking they have a parent #128

Closed yonaskolb closed 5 years ago

yonaskolb commented 5 years ago

This fixes cases like the following:

ChildWithNestedObject:
      allOf:
        - $ref: '#/components/schemas/ParentObject'
        - type: object
          properties:
            data:
              type: object
              properties:
                value:
                  type: string

Before, the nested object was generated as if it was a subclass of ParentObject. This is due to how Stencil's include tag works, and that if a property isn't found in the context it looks in its parent.