The generated angular file default.service.ts uses wrong import path delimiters on windows installation.
import { UpdateInfo } from '../modelupdateInfo';
Most propably it is using windows path seperator while doing path concatenation, what is not correct way how angular import path should be constructed.
Expected value is import { UpdateInfo } from '../model/updateInfo';
The generated file has also missing } bracket before EOF.
There is missing body parameter in generated post method:
return this.httpClient.post(${this.basePath}/someurl,
body, ---is missing in generated code
{ ....
The import path issue is also in generated api.module.ts containing
import { DefaultService } from './apidefault.service';
The generation was invoked by swager-codegen-cli with parameter -l typescript-angular
3.0.rc2 and 3.0.4
Yes, happens the same to me on v3.0.4 from a simple yaml file where my endpoint has one parameter.
Almost the same as https://github.com/swagger-api/swagger-codegen/issues/8930
Regarding to the missing body parameters, any updates on it?
Do you guys know how to rename this DefaultService in config?
I don't know why but the codegen doesn't add the body on post endpoints.
In exemple for me I had:
return this.httpClient.post
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
}
);
So i add manually the , body after the url.
return this.httpClient.post
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
}
);
I think the problem is caused by "isBodyAllowed()" method in "modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java".
Because after I removed {{#isBodyAllowed}}{{isBodyAllowed}} in "/handlebars/typescript-angular/api.service.mustache" the problem was solved.
Of course, there may be other trouble if removing "isBodyAllowed" tag, but it's fine for me.
Most helpful comment
Regarding to the missing body parameters, any updates on it?