-
-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: shuffle extra props to generate, closes #601 * fix: rework recursive references, closes #584 * fix: rework depth, closes #592 * chore: add missing tests * chore: pass json-path flag * cleanup
- Loading branch information
1 parent
971be18
commit 581aeb2
Showing
11 changed files
with
595 additions
and
141 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
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 |
---|---|---|
@@ -1,128 +1,26 @@ | ||
{ | ||
"description": "keep empty required objects", | ||
[ | ||
{ | ||
"description": "Required properties that result in empty objects get removed", | ||
"tests": [ | ||
{ | ||
"description": "should not remove empty objects defined with additionalProperties", | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"requiredProperty": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"requiredProperty" | ||
] | ||
}, | ||
"valid": true | ||
{ | ||
"description": "should eventually generate some props", | ||
"schema": { | ||
"additionalProperties": false, | ||
"type": "object", | ||
"properties": { | ||
"things": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"things" | ||
] | ||
}, | ||
{ | ||
"description": "should not remove empty arrays", | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"requiredProperty": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"requiredProperty" | ||
] | ||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "should not remove empty objects", | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"requiredProperty": { | ||
"type": "object", | ||
"properties": { | ||
"optionalProperty": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"requiredProperty" | ||
] | ||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "should not remove empty objects when required by oneOf but not by root schema", | ||
"schema": { | ||
"type": "object", | ||
"required": [ | ||
"id" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"properties": { | ||
"type": { | ||
"type": "object", | ||
"properties": {} | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"name" | ||
] | ||
} | ||
] | ||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "should not remove empty objects described in additionalProperties", | ||
"schema": { | ||
"type": "object", | ||
"minProperties": 1, | ||
"additionalProperties": { | ||
"required": [ | ||
"id" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"properties": { | ||
"type": { | ||
"type": "object", | ||
"properties": {} | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"name" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"valid": true | ||
} | ||
"valid": true | ||
} | ||
] | ||
} | ||
} | ||
] |
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,44 @@ | ||
[ | ||
{ | ||
"description": "Maximum call stack size & refDepthMax not work", | ||
"tests": [ | ||
{ | ||
"description": "should create items recursively", | ||
"schema": { | ||
"$ref": "#/definitions/A", | ||
"definitions": { | ||
"A": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"nodeA": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/A" | ||
} | ||
}, | ||
"nodeB": { | ||
"$ref": "#/definitions/B" | ||
} | ||
} | ||
}, | ||
"B": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"nodeB": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/B" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"repeat": 50, | ||
"valid": true | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.