-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle circular refs in properties, items, anyof, oneof
- Loading branch information
Showing
7 changed files
with
357 additions
and
26 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
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,25 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Circular Reference Example | ||
version: 1.0.0 | ||
paths: | ||
/endpoint: | ||
get: | ||
summary: Example endpoint | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Circular_1' | ||
|
||
components: | ||
schemas: | ||
Circular_1: | ||
type: object | ||
allOf: | ||
- $ref: '#/components/schemas/Circular_1' | ||
required: | ||
- name | ||
description: simple circular allof |
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,41 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Successful merge of Items with circular refs | ||
version: 1.0.0 | ||
paths: | ||
/endpoint: | ||
get: | ||
summary: Example endpoint | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Successful_Merge_1' | ||
|
||
components: | ||
schemas: | ||
Successful_Merge_1: | ||
type: object | ||
allOf: | ||
- type: object | ||
anyOf: | ||
- $ref: '#/components/schemas/Successful_Merge_1' | ||
- type: object | ||
properties: | ||
test: | ||
type: integer | ||
|
||
Failed_Merge_1: | ||
type: object | ||
allOf: | ||
- type: object | ||
anyOf: | ||
- $ref: '#/components/schemas/Failed_Merge_1' | ||
- type: object | ||
anyOf: | ||
- type: object | ||
properties: | ||
test: | ||
type: integer |
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,43 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Successful merge of Items with circular refs | ||
version: 1.0.0 | ||
paths: | ||
/endpoint: | ||
get: | ||
summary: Example endpoint | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Successful_Merge_1' | ||
|
||
components: | ||
schemas: | ||
Successful_Merge_1: | ||
type: object | ||
allOf: | ||
- type: object | ||
properties: | ||
test: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Successful_Merge_1' | ||
|
||
Failed_Merge_1: | ||
type: object | ||
allOf: | ||
- type: object | ||
properties: | ||
test: | ||
type: array | ||
items: | ||
type: integer | ||
- type: object | ||
properties: | ||
test: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Failed_Merge_1' |
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,41 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Successful merge of Items with circular refs | ||
version: 1.0.0 | ||
paths: | ||
/endpoint: | ||
get: | ||
summary: Example endpoint | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Successful_Merge_1' | ||
|
||
components: | ||
schemas: | ||
Successful_Merge_1: | ||
type: object | ||
allOf: | ||
- type: object | ||
oneOf: | ||
- $ref: '#/components/schemas/Successful_Merge_1' | ||
- type: object | ||
properties: | ||
test: | ||
type: integer | ||
|
||
Failed_Merge_1: | ||
type: object | ||
allOf: | ||
- type: object | ||
oneOf: | ||
- $ref: '#/components/schemas/Failed_Merge_1' | ||
- type: object | ||
oneOf: | ||
- type: object | ||
properties: | ||
test: | ||
type: integer |
Oops, something went wrong.