我想使用openapi生成器cli生成一个typescript获取客户端。Stoplight使用OpenAPI 3.1格式生成规范。但是,当我运行命令时
openapi-generator-cli generate -i resources/openapi/Attribute.yaml -o ../test/ -g typescript-fetch
我得到错误
[ERROR] i.s.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (String)"openapi: 3.1.0 ... ]
使用另一个openapi代码生成器(openapi typescript codegen(,我可以毫无问题地生成客户端代码,因此规范不仅经过验证,而且可用。这让人怀疑问题出在OpenAPI版本上。
OpenAPI typescript codegen支持OpenAPI 3.1吗?或者我可以做些什么来调整我的规范文件吗?
我正在使用
- openapi生成器cli 5.4.0
- OpenAPI 3.1
OpenAPI 3.1在Swagger和其他工具中还不受支持,包括OpenAPI生成器cli,这就是错误的原因。
这是最后一次(重要的(更新,团队仍在努力