-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Open
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
Lines 279 to 287 in 046db19
| 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/tsReactions are currently unavailable