Closed remkoboschker closed 5 years ago
As far as I understand the issue is that an import should be added the service. Will work on a PR
The fix I did for #28 works for other models that reference models in oneOf, not for inline objects in services...
If you'll work on a PR, here's a tip: ng-openapi-gen.ts
collects both service.imports
and service.additionalDependencies
. Somehow the Service
constructor in service.ts
should call collectImports(<something>, true)
for the oneOf
references.
@remkoboschker I pushed a fix to the one-of-path
branch.
Can you, please, test it?
@luisfpg good morning, I tested your one-of-path branch with our swagger file. I found two issues: I get a compile error missing :
here https://github.com/cyclosproject/ng-openapi-gen/blob/master/templates/requestBuilder.handlebars#L168 and the nullable-one-of patter
"avatar": {
"nullable": true,
"oneOf": [
{
"$ref": "#/components/schemas/AvatarDto"
}
]
},
also occures in components with a nullable reference. These are not imported at the moment. The component model shows a avatar?: null | AvatarDto;
, but the AvatarDto is not imported.
@remkoboschker Thanks for the feedback. I've pushed a fix. Can you, please, try it again?
Happy to help out. I’m away for a couple of days. Will test on Wednesday.
On 9 Aug 2019, at 13:19, Luis Fernando Planella Gonzalez notifications@github.com wrote:
@remkoboschker Thanks for the feedback. I've pushed a fix. Can you, please, try it again?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Thank you, all previouw issues seems to have been solved, but I found a new one. When a path
has a verb
with parameters
with a schema
with nullable
and oneOf
, the oneOf type is not imported in de service.
The model referenced in the path below is being ignored. It is referenced correctly in the service definition. But the model itself is not generated. I'm using 0.5.2