Skip to content

[C#] Not all referenced models are generated #4285

Closed
@mpazdnikova

Description

@mpazdnikova

Hi.

I'm using swaggerhub and have difficulties with correct client code generation for C#. When I reference some model from my domain, it is generated fine, but if this model have references to definitions from that domain, that are not referenced in spec, they are not generated in client code.

For example in my spec I have:

  SomeObject:
    type: object
    properties:
      SomeProperty:
        type: array
        items:
          $ref: '[link to domain]#/definitions/InnerModel'

And in domain:

  InnerModel:
    type: object
    properties:
      SomeEnumName:
        $ref: "#/definitions/SomeEnum"

  SomeEnum:
    type: string
    enum: [
      example,
      anotherexample]

Then in C# code there is mention of SomeEnum in InnerModel class, but the SomeEnum class itself is missing.

I am not sure if that's a bug or some mistake from my side, but it would be nice if these transitive models were properly generated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions