-
-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the
circular-extended
tests to use external $refs rather…
… than just internal ones. This tests a few edge cases that weren't covered before
- Loading branch information
1 parent
cac28c6
commit ca9b322
Showing
16 changed files
with
480 additions
and
481 deletions.
There are no files selected for viewing
30 changes: 2 additions & 28 deletions
30
tests/specs/circular-extended/circular-extended-ancestor.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 |
---|---|---|
@@ -1,32 +1,6 @@ | ||
definitions: | ||
person: | ||
title: person | ||
properties: | ||
name: | ||
type: string | ||
spouse: | ||
$ref: "#/definitions/person" | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "person". | ||
pet: | ||
$ref: '#/definitions/pet' | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "pet". | ||
$ref: definitions/person-with-spouse.yaml | ||
|
||
pet: | ||
title: pet | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
age: | ||
type: number | ||
species: | ||
type: string | ||
enum: | ||
- cat | ||
- dog | ||
- bird | ||
- fish | ||
$ref: definitions/pet.yaml |
43 changes: 3 additions & 40 deletions
43
tests/specs/circular-extended/circular-extended-indirect-ancestor.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 |
---|---|---|
@@ -1,46 +1,9 @@ | ||
definitions: | ||
parent: | ||
title: parent | ||
properties: | ||
name: | ||
type: string | ||
child: | ||
$ref: '#/definitions/child' | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "child". | ||
$ref: definitions/parent-with-child.yaml | ||
|
||
child: | ||
title: child | ||
properties: | ||
name: | ||
type: string | ||
pet: | ||
$ref: '#/definitions/pet' | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "pet". | ||
children: | ||
description: children | ||
type: array | ||
items: | ||
$ref: '#/definitions/child' | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "child". | ||
$ref: definitions/child-with-children.yaml | ||
|
||
pet: | ||
title: pet | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
age: | ||
type: number | ||
species: | ||
type: string | ||
enum: | ||
- cat | ||
- dog | ||
- bird | ||
- fish | ||
$ref: definitions/pet.yaml |
44 changes: 3 additions & 41 deletions
44
tests/specs/circular-extended/circular-extended-indirect.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 |
---|---|---|
@@ -1,47 +1,9 @@ | ||
definitions: | ||
parent: | ||
title: parent | ||
properties: | ||
name: | ||
type: string | ||
children: | ||
type: array | ||
items: | ||
$ref: "#/definitions/child" | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "child". | ||
$ref: definitions/parent-with-children.yaml | ||
|
||
child: | ||
title: child | ||
properties: | ||
name: | ||
type: string | ||
pet: | ||
$ref: '#/definitions/pet' | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "pet". | ||
parents: | ||
type: array | ||
items: | ||
$ref: "#/definitions/parent" | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
This creates a new type that extends "parent". | ||
$ref: definitions/child-with-parents.yaml | ||
|
||
pet: | ||
title: pet | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
age: | ||
type: number | ||
species: | ||
type: string | ||
enum: | ||
- cat | ||
- dog | ||
- bird | ||
- fish | ||
$ref: definitions/pet.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 |
---|---|---|
@@ -1,8 +1,3 @@ | ||
definitions: | ||
thing: | ||
title: thing | ||
$ref: "#/definitions/thing" | ||
description: > | ||
This JSON Reference has additional properties (other than $ref). | ||
Normally, this creates a new type that extends the referenced type, | ||
but since this reference points to ITSELF, it doesn't do that. | ||
$ref: "definitions/thing.yaml" |
139 changes: 139 additions & 0 deletions
139
tests/specs/circular-extended/circular-extended.bundled.js
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,139 @@ | ||
helper.bundled.circularExtended = | ||
{ | ||
"self": { | ||
"definitions": { | ||
"thing": { | ||
"title": "thing", | ||
"$ref": "#/definitions/thing", | ||
"description": "This JSON Reference has additional properties (other than $ref). Normally, this creates a new type that extends the referenced type, but since this reference points to ITSELF, it doesn't do that.\n", | ||
} | ||
} | ||
}, | ||
|
||
pet: { | ||
"title": "pet", | ||
"type": "object", | ||
"properties": { | ||
"age": { | ||
type: "number" | ||
}, | ||
"name": { | ||
type: "string" | ||
}, | ||
"species": { | ||
"type": "string", | ||
"enum": [ | ||
"cat", | ||
"dog", | ||
"bird", | ||
"fish" | ||
], | ||
}, | ||
}, | ||
}, | ||
|
||
ancestor: { | ||
"definitions": { | ||
"person": { | ||
"title": "person", | ||
"properties": { | ||
"spouse": { | ||
"$ref": "#/definitions/person", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"person\".\n", | ||
}, | ||
"pet": { | ||
$ref: "#/definitions/pet", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"pet\".\n" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"pet": null | ||
} | ||
}, | ||
|
||
indirect: { | ||
"definitions": { | ||
"parent": { | ||
"title": "parent", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"children": { | ||
"items": { | ||
"$ref": "#/definitions/child", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"child\".\n", | ||
}, | ||
"type": "array" | ||
} | ||
} | ||
}, | ||
"child": { | ||
"title": "child", | ||
"properties": { | ||
"parents": { | ||
"items": { | ||
"$ref": "#/definitions/parent", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"parent\".\n", | ||
}, | ||
"type": "array" | ||
}, | ||
"pet": { | ||
"$ref": "#/definitions/pet", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"pet\".\n", | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"pet": null | ||
} | ||
}, | ||
|
||
indirectAncestor: { | ||
"definitions": { | ||
"pet": null, | ||
"parent": { | ||
"title": "parent", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"child": { | ||
"$ref": "#/definitions/child", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"child\".\n", | ||
} | ||
}, | ||
}, | ||
"child": { | ||
"title": "child", | ||
"properties": { | ||
"pet": { | ||
"$ref": "#/definitions/pet", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"pet\".\n", | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"children": { | ||
"items": { | ||
"$ref": "#/definitions/child", | ||
"description": "This JSON Reference has additional properties (other than $ref). This creates a new type that extends \"child\".\n", | ||
}, | ||
"type": "array", | ||
"description": "children" | ||
} | ||
}, | ||
} | ||
} | ||
} | ||
}; | ||
|
||
helper.bundled.circularExtended.ancestor.definitions.pet = | ||
helper.bundled.circularExtended.indirect.definitions.pet = | ||
helper.bundled.circularExtended.indirectAncestor.definitions.pet = | ||
helper.bundled.circularExtended.pet; |
Oops, something went wrong.