OpenAPITools / OpenAPITools/openapi-generator
[BUG][SPRING] Tag description generates interfaces that do not compile
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Tags with description that contain a line break or quotes break the spring generator.
Details:
If you have a tag description with a line break or using quotes ("), it will break the generator due to this line
openapi-generator version
6.0.0
OpenAPI declaration file content or url
https://github.com/oscarfh/springgeneratorreproducer/blob/main/src/main/resources/openapi.yaml
Generation Details
run ./mvnw clean compile in the reproducer and see how the generated PetApi class does not compile. Or believe and see how the generated class does not compile due to the content of the tag description.
Steps to reproduce
1- Clone the reproducer
2- Run ./mvnw clean compile
3- See how it does not compile
Related issues/PRs
Suggest a fix
Undo this change
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with modules/openapi-generator/src/main/resources/JavaSpring/api.mustache and the linked OpenAPI declaration, then run ./mvnw clean compile in the springgeneratorreproducer. Compare the generated PetApi.java with the tag description containing a line break or quotes; done means the generated interface compiles successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, spring
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100