-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from faradayio/hk/nullable-option
Support 3.0.X nullability
- Loading branch information
Showing
8 changed files
with
280 additions
and
118 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# AUTOMATICALLY GENERATED. DO NOT EDIT. | ||
--- | ||
openapi: 3.0.0 | ||
paths: {} | ||
components: | ||
schemas: | ||
Polygon: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
mutable: true | ||
number_of_sides: | ||
type: number | ||
mutable: true | ||
Widget: | ||
type: object | ||
required: | ||
- id | ||
- name | ||
properties: | ||
comment: | ||
type: string | ||
id: | ||
type: string | ||
example: e35a3c8d-5486-49ec-9b23-6747afc19570 | ||
name: | ||
type: string | ||
shape: | ||
$ref: "#/components/schemas/Polygon" | ||
additionalProperties: false | ||
description: "A displayable widget.\n" | ||
WidgetMergePatch: | ||
type: object | ||
properties: | ||
comment: | ||
type: string | ||
nullable: true | ||
name: | ||
type: string | ||
shape: | ||
oneOf: | ||
- $ref: "#/components/schemas/Polygon" | ||
nullable: true | ||
additionalProperties: false | ||
description: "(Parameters used to PATCH the `Widget` type.)\n\nA displayable widget.\n" | ||
WidgetPost: | ||
type: object | ||
required: | ||
- name | ||
properties: | ||
comment: | ||
type: string | ||
name: | ||
type: string | ||
shape: | ||
$ref: "#/components/schemas/Polygon" | ||
additionalProperties: false | ||
description: "(Parameters used to POST a new value of the `Widget` type.)\n\nA displayable widget.\n" | ||
WidgetPut: | ||
type: object | ||
required: | ||
- name | ||
properties: | ||
comment: | ||
type: string | ||
name: | ||
type: string | ||
shape: | ||
$ref: "#/components/schemas/Polygon" | ||
additionalProperties: false | ||
description: "(Parameters used to PUT a value of the `Widget` type.)\n\nA displayable widget.\n" | ||
info: | ||
title: Example OpenAPI definition |
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
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
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
Oops, something went wrong.