-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Fix complex intersections of allOf/anyOf/properties/required (…
…fix #381)
- Loading branch information
Showing
8 changed files
with
1,339 additions
and
101 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
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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,15 @@ | ||
export const input = { | ||
type: 'object', | ||
properties: { | ||
a: {type: 'string'}, | ||
b: {type: 'string'}, | ||
c: {type: 'string'}, | ||
}, | ||
allOf: [ | ||
{required: ['a']}, | ||
{ | ||
oneOf: [{required: ['b']}, {required: ['c']}], | ||
}, | ||
], | ||
additionalProperties: false, | ||
} |
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,14 @@ | ||
export const input = { | ||
type: 'object', | ||
properties: { | ||
a: {type: 'string'}, | ||
b: {type: 'string'}, | ||
c: {type: 'string'}, | ||
}, | ||
allOf: [ | ||
{required: ['a']}, | ||
{ | ||
oneOf: [{required: ['b']}, {required: ['c']}], | ||
}, | ||
], | ||
} |
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 @@ | ||
export const input = { | ||
type: 'object', | ||
properties: { | ||
a: {type: 'string'}, | ||
b: {type: 'string'}, | ||
c: {type: 'string'}, | ||
}, | ||
allOf: [ | ||
{required: ['a']}, | ||
{ | ||
oneOf: [ | ||
{required: ['b']}, | ||
// Non-existent property is invalid, but it's not up to JSTT to validate this | ||
// "An object instance is valid against this keyword if every | ||
// item in the array is the name of a property in the instance." | ||
// @see https://json-schema.org/draft/2020-12/json-schema-validation#name-required | ||
{required: ['d']}, | ||
], | ||
}, | ||
], | ||
} |
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