Openapi Swagger生成Java Restemplate客户端
我正在使用OpenAPI 3生成Java HTTP客户端。
在我的Maven插件配置中,我正在使用“ RESTTEMPLATE”:
但是在生成的来源中,我得到了 apiclient
类来处理HTTP调用。 apiclient
来自泽西库。没有提及Spring RESTTEMPLATE
类:
这是正常的吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
摘自此链接的文档:
在大表格中搜索
library
config选项,您会看到这两个Library
配置选项的选择是Spring-Boot
或Spring-Cloud
。您正在使用RESTTEMPLATE
,这是无效的。(您正在使用发电机的5.1.0版本,我正在使用5.0.0,但是我很确定我提供的链接适用于两者。)
From the documentation at this link: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/spring.md
Search for the
library
config option in the big table, and you'll see that the two choices for thelibrary
config option arespring-boot
orspring-cloud
. You're usingresttemplate
, which is not valid.(You're using version 5.1.0 of the generator, I'm using 5.0.0, but I'm pretty sure the link I provided applies to both.)