-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JAVA] Generate client files with multiple enum
oneOf
types (#12687)
* handle multiple enum types for oneof * add updates from generate-samples.sh * add test coverage for oneof enum generation * update doc and var names for clarity
- Loading branch information
Showing
3 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
modules/openapi-generator/src/test/resources/3_0/issue12545.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "OpenAPI Petstore" | ||
}, | ||
"paths": { | ||
"/": { | ||
"get": { | ||
"description": "get all pets in a household", | ||
"responses": { | ||
"200": { | ||
"description": "successful operation", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Household" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Household": { | ||
"title": "Household", | ||
"type" : "object", | ||
"required": [ | ||
"pets" | ||
], | ||
"properties": { | ||
"pets": { | ||
"type": "array", | ||
"title": "pets", | ||
"items" : { | ||
"title": "petItems", | ||
"oneOf" : [ { | ||
"$ref" : "#/components/schemas/Dog" | ||
}, { | ||
"$ref" : "#/components/schemas/Cat" | ||
} ] | ||
} | ||
} | ||
} | ||
}, | ||
"Dog": { | ||
"type" : "object", | ||
"title": "Dog", | ||
"properties" : { | ||
"type" : { | ||
"type" : "string", | ||
"enum" : [ "dog" ] | ||
} | ||
}, | ||
"required" : [ "type" ] | ||
}, | ||
"Cat": { | ||
"type" : "object", | ||
"title": "Cat", | ||
"properties" : { | ||
"type" : { | ||
"type" : "string", | ||
"enum" : [ "cat" ] | ||
} | ||
}, | ||
"required" : [ "type" ] | ||
} | ||
} | ||
} | ||
} |