[BUG] openapi-generator-maven-plugin version 5.0.0 does not work for OpenApi 3.0 yml-files
See original GitHub issueDescription
I have a perfect OpenApi 3.0.1 yml-file. openapi-generator-maven-plugin v4.3.1 generates perfect code. When changing the plugin version from 4.3.1 to 5.0.0 I get a syntax error. No other changes.
[INFO] [INFO] — openapi-generator-maven-plugin:5.0.0:generate (api) @ core-automation — [ERROR] 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: (StringReader); line: 1, column: 8]
openapi-generator version
5.0.0
OpenAPI declaration file content or url
openapi: 3.0.1
info:
title: my Title
description: Documentation of my REST APIs.
...
Generation Details
mvn install
Steps to reproduce
mvn install
Related issues/PRs
N/A
Suggest a fix
???
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Open Api Generator plugin does not work with Maven
I am trying to generate Apis with openapi generator just when i run mvn compile seems like doesn't find any depenncy like jacks...
Read more >Plugins - OpenAPI Generator
Lists generators available via Open API Generators. openApiMeta, Generates a new generator to be consumed via Open API Generator.
Read more >openapitools/openapi-generator - Docker Image - Docker Hub
Automated builds of openapi-generator images.
Read more >OpenAPI 3.0 Tutorial | SwaggerHub Documentation
OpenAPI 3.0 is an open-source format for describing and documenting APIs. ... openapi: 3.0.0 info: version: 1.0.0 title: Sample API ...
Read more >How to use contract first approach with Open API - LinkedIn
We will be using the openapi-generator-maven-plugin to generate server (interface only to ... <spring-fix.version>3.0.0</spring-fix.version> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We had the same issue with the URL
It worked for builds on a Linux machine but failed for builds on a Windows machine.
We changed the URL to
and now it works.
Two major questions:
From the documentation:
Hi @stephanpelikan, regarding 1, the code assumes that if there is an error that it isn’t a YAML file and then tries the JSON variant. Which fails due to
openapi
not being{
or other valid JSON token.Regarding 2, once the upstream library is fixed and the plugin is updated the problem should go away. See also the comment by @wing328 above yours.