Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created March 20, 2023 03:30
Show Gist options
  • Save tokuhirom/4b0204f2e7fc8768f1a803accb569aa9 to your computer and use it in GitHub Desktop.
Save tokuhirom/4b0204f2e7fc8768f1a803accb569aa9 to your computer and use it in GitHub Desktop.
---
openapi: 3.0.3
info:
title: Example
version: 1.0.0
servers:
- url: 'https://example.com/'
paths:
/callback:
post:
responses:
'200':
description: test
content:
application/json:
schema:
$ref: "#/components/schemas/Event"
components:
schemas:
Event:
type: object
oneOf:
- $ref: "#/components/schemas/MyGreatEvent"
discriminator:
propertyName: type
mapping:
great: '#/components/schemas/MyGreatEvent'
MyGreatEvent:
allOf:
- $ref: '#/components/schemas/Event'
- type: object
required:
- type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment