I am struggling to create a TypeScript-Angular SDK using the OpenAPI spec from Loopback4, but Swagger-codegen keeps disregarding my query parameter objects.
In the specification below, you can see the path GET /plans which can contain a filter query parameter. In the generated class, you see the method
planControllerFind(?:, observe: ...)
which only has ?:
as the first parameter instead of planControllerFind(filter?: FilterClass, observe: ...)
I have experimented with different specification structures and also tried various versions of Swagger-codegen (3.0.11, 3.0.16, 3.0.18) but nothing seems to resolve the issue. Even the online version generates incomplete code.
Could anyone provide me with some guidance?
The code was generated using:
swagger-codegen generate -i http://localhost:3000/explorer/openapi.json -l typescript-angular -o app/src/app/core/lb4-sdk -c ./swagger-sdk.options.json
where the /swagger-sdk.options.json
file looks like this:
{
"npmName": "@ilem0n/ng-budget-api",
"npmVersion": "0.0.1",
"snapshot": true,
"ngVersion": "5.0.0"
}
Here is the spec generated from Loopback4:
// The full OpenAPI spec goes here...
From this spec, the following class for the planController was generated:
// Automatically generated Angular service Class...