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
|
public static String getSimpleRef(String ref) { |
|
if (ref.startsWith("#/components/")) { |
|
ref = ref.substring(ref.lastIndexOf("/") + 1); |
|
} else if (ref.startsWith("#/definitions/")) { |
|
ref = ref.substring(ref.lastIndexOf("/") + 1); |
|
} else { |
|
LOGGER.warn("Failed to get the schema name: {}", ref); |
|
//throw new RuntimeException("Failed to get the schema: " + ref); |
|
return null; |
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 grpc-ecosystem/grpc-gateway#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
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
openapi-generator/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java
Lines 279 to 287 in 046db19
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 grpc-ecosystem/grpc-gateway#850 ) This generator puts
x-stream-definitionsrefs at the root of the openAPI spec. Which gives these warningsopenapi-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