OpenAPITools / OpenAPITools/openapi-generator
Generator fails with non-specific error instead of saying it doesn't support the version of OAS
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
I have an OpenAPI 3.1 API definition, which I converted from YAML to JSON because of https://github.com/OpenAPITools/openapi-generator/issues/9520
Attempting to generate any code with it fails, with only:
Exception in thread "main" java.lang.RuntimeException: Issues with the OpenAPI input. Possible causes: invalid/missing spec, malformed JSON/YAML files, etc.
openapi-generator version
6.0.1
OpenAPI declaration file content or url
{
"openapi": "3.1.0",
"info": {
"version": "1.0.0",
"title": "MediaDevice API",
...
}
Generation Details
The command I used:
openapi-generator-cli generate -i deviceAPI.json -g nodejs-express-server -o ~/node_server
Steps to reproduce
Try to generate code from any OAS 3.1 document (JSON currently because YAML is broken).
Suggest a fix
Raise an error message saying that the version of OAS is not supported by the generator.
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 by reproducing the openapi-generator-cli generate command with the supplied deviceAPI.json containing openapi: 3.1.0, then trace the generator's input-validation error path. Done means an unsupported OAS version produces a specific error instead of the generic input failure, with regression coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100