Skip to content

Instantly share code, notes, and snippets.

@dpkirchner
Created August 27, 2021 17:18
Show Gist options
  • Save dpkirchner/3e41497358e9890b70af42d704b7ec9e to your computer and use it in GitHub Desktop.
Save dpkirchner/3e41497358e9890b70af42d704b7ec9e to your computer and use it in GitHub Desktop.
type: object
properties:
type:
type: string
default: a
type: object
properties:
type:
type: string
default: b
type: object
properties:
type:
type: string
enum:
- a
- b
discriminator:
propertyName: type
mapping:
a: './item-a.yaml'
b: './item-b.yaml'
required:
- type
openapi: 3.0.0
info:
version: 1.0.0
title: Test
tags:
- name: Resource
description: |
<SchemaDefinition schemaRef="#/components/schemas/Resource"/>
- name: User
description: |
<SchemaDefinition schemaRef="#/components/schemas/User"/>
x-tagGroups:
- name: Output models
tags:
- Resource
- User
components:
schemas:
Resource:
$ref: './resource.yaml'
User:
$ref: './user.yaml'
type: object
required:
- user
properties:
items:
type: array
items:
$ref: './item.yaml'
type: object
required:
- username
properties:
username:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment