OpenAPITools / OpenAPITools/openapi-generator

[BUG] openapi-generator-maven-plugin version 5.0.0 does not work for OpenApi 3.0 yml-files

Open
#8,260 9 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

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

???

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the openapi-generator-maven-plugin 5.0.0 generation entry point and reproduce the failure using the provided OpenAPI 3.0.1 YAML and mvn install. Compare the same generation with plugin version 4.3.1 to isolate the regression. Done means the unchanged YAML is accepted by 5.0.0 and code generation completes without the JSON parse error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.