当使用这个OpenApi发生器版本2.4.26 (“@openapitools/openapi生成器-cli”:"^2.4.26")时,我得到的是失败的角服务(角验证13.2.0)。例如:它们将许多参数传递给角度HttpClient,这样代码甚至不会编译。
我使用以下命令生成代码:openapi-generator-cli generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-angular -o libs/openapi.
我是不是漏掉了一些我必须通过的财产?还是有一个角度开放的发生器兼容性表之类的?
发布于 2022-04-10 06:07:13
与此相同,还指定了with --附加-properties=ngVersion=13.2.4。错误:预期1-2参数,但得到3。
发布于 2022-06-27 13:03:50
这很可能是由于这个问题(https://github.com/OpenAPITools/openapi-generator/issues/10864),其中生成器为请求体创建一个带有附加null值的delete方法。临时地,当您从方法中移除第二个参数时,错误会迅速解决。
示例:
return this.httpClient.delete<any>(`${this.configuration.basePath}/api/foo/bar/${encodeURIComponent(String(id))}`,
null, // <--- this is the argument you want to remove
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
}
);https://stackoverflow.com/questions/71635683
复制相似问题