OpenAPITools / OpenAPITools/openapi-generator
[BUG] extension refs are not supported
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
The generator ignores OpenAPI extension references ( https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#patterned-objects ) because this conditional has whitelist of references
I'm using the GRPC-gateway to generate openAPI spec for my gRPC apis, and it uses OpenAPI extensions to hold references to the stream response (See this PR https://github.com/grpc-ecosystem/grpc-gateway/pull/850 ) This generator puts x-stream-definitions refs at the root of the openAPI spec. Which gives these warnings
[main] WARN o.o.codegen.utils.ModelUtils - #/x-stream-definitions/aggregationListAggregationsResponse is not defined
[main] WARN o.o.codegen.utils.ModelUtils - Failed to get the schema name: #/x-stream-definitions/aggregationListAggregationsResponse
openapi-generator version
4.0.0
OpenAPI declaration file content or url
https://gist.github.com/seanlaff/9a8d88027bd775b5ef31e63abf3fb946
Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.0.0-beta generate \
-i /local/test.json \
-g typescript-axios \
-o /local/out/ts
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 the whitelist conditional in modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java at the linked lines, then reproduce the issue with the provided gist and Docker generation command. Compare generation involving the x-stream-definitions references against the reported warnings. Done means extension references are handled without those warnings.
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
- Clearly specified
- Newbie friendliness
- 45/100