1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Testing the --use-deprecated-nullable option
openapi: "3.1.0"
info:
title: Example OpenAPI definition
components:
schemas:
Polygon:
type: object
properties:
name:
mutable: true
type: string
number_of_sides:
mutable: true
type: number
interfaces:
Resource:
emit: false # Do not include this in generated output.
members:
id:
required: true
schema:
type: string
Widget:
$includes: "Resource"
description: |
A displayable widget.
members:
# We can override properties from `Resource` using JSON
# Merge Patch syntax.
id:
schema:
example: e35a3c8d-5486-49ec-9b23-6747afc19570
name:
required: true
# We want to include a test for primitive types
mutable: true
schema:
type: string
comment:
mutable: true
schema:
type: string
shape:
# We also want to include a test for properties that are
# $refs. If mutable, this will be turned into a oneOf object
# where nullable: true.
mutable: true
schema:
$ref: "#/components/schemas/Polygon"