Skip to content

Instantly share code, notes, and snippets.

@ajoga
Created October 5, 2023 10:00
Show Gist options
  • Save ajoga/6a9085104954d009682a3403a0658d1c to your computer and use it in GitHub Desktop.
Save ajoga/6a9085104954d009682a3403a0658d1c to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Sample
description: Example
version: 1.0.0
servers:
- url: http://{{api_endpoint}}
components:
schemas:
simple_object1:
type: object
properties:
arg1:
type: string
simple_object2:
type: object
properties:
arg2:
type: string
composite_object:
anyOf:
- allOf:
- $ref: "#/components/schemas/simple_object1"
- $ref: "#/components/schemas/simple_object2"
- allOf:
- $ref: "#/components/schemas/simple_object1"
- $ref: "#/components/schemas/simple_object2"
paths:
/example:
get:
responses:
"200":
description: OK
# content:
# application/json:
# schema:
# anyOf:
# - allOf:
# - $ref: "#/components/schemas/simple_object1"
# - $ref: "#/components/schemas/simple_object2"
# - allOf:
# - $ref: "#/components/schemas/simple_object1"
# - $ref: "#/components/schemas/simple_object2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment