ng-openapi-gen icon indicating copy to clipboard operation
ng-openapi-gen copied to clipboard

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

Open manishchauhan30 opened this issue 2 years ago • 5 comments

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.

manishchauhan30 avatar Aug 25 '22 12:08 manishchauhan30

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

TheRealGI avatar Sep 25 '22 20:09 TheRealGI

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

LoaderB0T avatar Mar 15 '23 08:03 LoaderB0T

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.

luisfpg avatar Mar 16 '23 18:03 luisfpg

same problem met

pillsilly avatar Jul 26 '23 14:07 pillsilly

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.

pillsilly avatar Jul 26 '23 15:07 pillsilly