Consider limiting message size for exceptions thrown from DefaultGenerator.processOperation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
Start at modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java around line 1603, where DefaultGenerator.processOperation constructs the exception message. Reproduce the failure with a large OpenAPI specification and an operation whose query parameter has an empty name. Done means the exception no longer overwhelms console output while retaining useful operation details such as the operation name, tag, or resource.
Written by the indexing model from the issue text.
Description
I was given a large 40 000 line spec with a few hundred operations, where a single operation had a query parameter with empty name. Naturally, the generator threw.
Trying to be helpful, the exception message contains the entire schema. For a 40 000 line spec, that schema is massive. It completely overruns my console, losing the actual error information in the process.
Suggestion: Put a limit on the schema length when constructing the exception message. Take the first 10000 chars of the schema or something. Or maybe reorder the message and put the schemas first such that when the message gets cut off, the short descriptors (operation name, tag, resource) remain available
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 103
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.
More from OpenAPITools/openapi-generator
-
Issue: Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
OpenAPITools/openapi-generator#24978 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenAPITools/openapi-generator#24975 ·
-
Issue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenAPITools/openapi-generator#24859 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenAPITools/openapi-generator#24852 · 1 comment ·
-
[BUG][KOTLIN] Fails to compile after updating to 7.25.0 with useJackson3=false useSpringBoot4=true OpenIssue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenAPITools/openapi-generator#24842 · 1 comment ·
All issues in OpenAPITools/openapi-generator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100