-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: default error for compose models schema that does not use array
- added default error for oneOf, anyOf, or allOf schema that is not use top-level array - added no_array_for_compose_models config option and set its default value to 'error' - updated schema-ibm test to import the default config values and made necessary changes to test to account for unexpected errors and warnings resulting from having all default values present - added tests when oneOf, anyOf, or allOf schemas are nested ("oneOf allOf," for example), when oneOf, anyOf, or allOf schema is used as a property in an obect, and when oneOf, anyOf, or allOf schema used as items in array
- Loading branch information
Barrett Schonefeld
committed
Feb 19, 2020
1 parent
80b7a45
commit 83d976c
Showing
9 changed files
with
289 additions
and
160 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
22 changes: 22 additions & 0 deletions
22
test/cli-validator/mockFiles/oas3/complexTestComposeModel.yaml
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,22 @@ | ||
openapi: 3.0.0 | ||
components: | ||
schemas: | ||
A: | ||
description: a schema | ||
type: string | ||
format: byte | ||
complexOneOfError: | ||
description: second oneOf should be array | ||
oneOf: | ||
- oneOf: | ||
$ref: '#/components/schemas/A' | ||
complexAllOfError: | ||
description: allOf should be array | ||
oneOf: | ||
- allOf: | ||
type: string | ||
complexAnyOfError: | ||
description: anyOf should be array | ||
oneOf: | ||
- anyOf: | ||
$ref: '#/components/schemas/A' |
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,21 @@ | ||
openapi: 3.0.0 | ||
components: | ||
schemas: | ||
one_of_array: | ||
type: array | ||
description: a oneOf array schema | ||
items: | ||
oneOf: | ||
type: string | ||
all_of_array: | ||
type: array | ||
description: an allOf array schema | ||
items: | ||
allOf: | ||
type: string | ||
any_of_array: | ||
type: array | ||
description: an anyOf array schema | ||
items: | ||
anyOf: | ||
type: string |
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,22 @@ | ||
openapi: 3.0.0 | ||
components: | ||
schemas: | ||
object1: | ||
type: object | ||
description: an object schema | ||
properties: | ||
one_of_error_prop: | ||
description: second oneOf should be array | ||
schema: | ||
oneOf: | ||
type: string | ||
all_of_error_prop: | ||
description: allOf should be array | ||
schema: | ||
allOf: | ||
type: string | ||
any_of_error_prop: | ||
description: anyOf should be array | ||
schema: | ||
anyOf: | ||
type: string |
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,19 @@ | ||
openapi: 3.0.0 | ||
components: | ||
schemas: | ||
A: | ||
description: a schema | ||
type: string | ||
format: byte | ||
oneOfError: | ||
description: should be array but instead just a ref | ||
oneOf: | ||
$ref: '#/components/schemas/A' | ||
allOfError: | ||
description: should be array but instead just a type | ||
allOf: | ||
type: string | ||
anyOfError: | ||
description: should be array but instead just a ref | ||
anyOf: | ||
$ref: '#/components/schemas/A' |
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.