ng-openapi-gen
ng-openapi-gen copied to clipboard
Not able to generate Models if there is a separate file for schema
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.
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
Sorry for the dupe (#269), but it contains a reproduction scenario if anyone is interested in analyzing and/or fixing it.
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.
same problem met
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.