cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
397 stars 132 forks source link

Not able to generate Models if there is a separate file for schema #234

Open manishchauhan30 opened 2 years ago

manishchauhan30 commented 2 years ago

The library is not able to generate models if both API and response objects are present in different YML files. Only the APIs are generated and an empty model.ts is created. The return type of API methods are mentioned as { property1, property2 } for example.

TheRealGI commented 2 years ago

Hey @manishchauhan30,

I assume you use the $ref tag for referencing external files into the main file? Could you provide these files here or as a gist? Thanks

LoaderB0T commented 1 year ago

Sorry for the dupe (#269), but it contains a reproduction scenario if anyone is interested in analyzing and/or fixing it.

luisfpg commented 1 year ago

Personally, I'm having almost no time to work in this project in the last years. It suites our requirements well (https://github.com/cyclosproject/cyclos4-ui) and way more. The only possibility of new features to be added user contribution.

pillsilly commented 1 year ago

same problem met

pillsilly commented 1 year ago

In my case, it's like REST paths are defined in A.yaml while corresponding models are mostly placed in B.yaml.

and when in B we have a Model semantically be like

M:
{
x: Array<Person>
y: Array<Person>
}

then Person won't be generated as expected

I found a WA that is to locally define Person in A.yaml, and use $ref to avoid to much duplication.

    Person:
      $ref: "B.yaml#/components/schemas/Person"

this somehow results expected output, for my case.