Created
May 8, 2024 14:28
-
-
Save rei-ber/53a9c9bbf57ecd4d49e955f02fe33c46 to your computer and use it in GitHub Desktop.
anyOf openapi spec example (broken for openapi-generator)
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
{ | |
"components": { | |
"schemas": { | |
"Reputation": { | |
"properties": { | |
"fieldref": { | |
"title": "Fieldref", | |
"type": "string" | |
}, | |
"mark": { | |
"title": "Mark", | |
"type": "string" | |
}, | |
"ttl": { | |
"title": "Ttl", | |
"type": "integer" | |
} | |
}, | |
"required": [ | |
"fieldref", | |
"mark", | |
"ttl" | |
], | |
"title": "Reputation", | |
"type": "object" | |
}, | |
"UsecaseData": { | |
"properties": { | |
"reputation": { | |
"anyOf": [ | |
{ | |
"$ref": "#/components/schemas/Reputation" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"default": null | |
} | |
}, | |
"required": [], | |
"title": "UsecaseDataUUID", | |
"type": "object" | |
} | |
} | |
}, | |
"info": { | |
"title": "anyof example", | |
"version": "v1" | |
}, | |
"openapi": "3.1.0", | |
"paths": { | |
"/api/v1/usecases": { | |
"post": { | |
"description": "", | |
"operationId": "post_post_usecase", | |
"parameters": [], | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"properties": { | |
"reputation": { | |
"anyOf": [ | |
{ | |
"$ref": "#/components/schemas/Reputation" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"default": null | |
} | |
}, | |
"required": [ | |
], | |
"title": "UsecaseData", | |
"type": "object" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"201": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"properties": { | |
"reputation": { | |
"anyOf": [ | |
{ | |
"$ref": "#/components/schemas/Reputation" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"default": null | |
} | |
}, | |
"required": [ | |
], | |
"title": "UsecaseDataUUID", | |
"type": "object" | |
} | |
} | |
}, | |
"description": "" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment