I am interested in creating a TypeScript-fetch client using openapi-generator-cli. The specifications were produced by Stoplight following the OpenAPI 3.1 format. However, when I execute the command
openapi-generator-cli generate -i resources/openapi/Attribute.yaml -o ../test/ -g typescript-fetch
I encounter an error:
[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 ... ]
Using another OpenAPI code generator (openapi-typescript-codegen), I am able to successfully generate client code from the validated and usable specs file. This leads me to believe that the problem lies with the compatibility of the OpenAPI version.
Does openapi-typescript-codegen support OpenAPI 3.1, or is there a way for me to adjust my specs file to make it work?
The tools I am currently using include:
- openapi-generator-cli 5.4.0
- OpenAPI 3.1