OpenAPITools / OpenAPITools/openapi-generator

[BUG] [Spring] Upgrading api generator from 4.3.1 to 6.1.0 fails to parse "tags" descriptions

Open
#13,579 2 comments 0 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

After upgrading API generator from 4.3.1 to 6.1.0 fails to parse "tags" descriptions with new line pipe | failed to parse.
it's very easy to reproduce
All you need is to have a pipe as part of your description, new line and some text

openapi-generator version

6.1.0

OpenAPI declaration file content or url
tags:
  - name: pets
    description: |
     # Everything about your Pets
        Some very long description 
Generation Details
Steps to reproduce

run the spring build, there will be an compilation error

Error snake-parsing yaml content 
at io.swagger.v3.parser.util.DeseralizationUtils$CustomSnakeYamlConstructor.getSinglrData(DeseralizationUtils.java:417)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:491)
Related issues/PRs
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 failing Spring build and the stack trace location in DeseralizationUtils.java at line 417, where SnakeYAML reports the parsing error. Reproduce the issue using the provided OpenAPI tags description containing a pipe and a newline; done means the declaration parses and Spring generation completes without the compilation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, yaml
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.