-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #623 from ergebnis/feature/any-of
Enhancement: Adjust `SchemaNormalizer` to support `anyOf`
- Loading branch information
Showing
12 changed files
with
187 additions
and
5 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
11 changes: 11 additions & 0 deletions
11
.../SchemaNormalizer/NormalizeNormalizes/Data/IsArray/Schema/HasAnyOf/Direct/normalized.json
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,11 @@ | ||
[ | ||
{ | ||
"type": "Website", | ||
"url": "https://localheinz.com" | ||
}, | ||
"https://github.com/localheinz", | ||
{ | ||
"type": "Twitter", | ||
"url": "https://twitter.com/localheinz" | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
...re/SchemaNormalizer/NormalizeNormalizes/Data/IsArray/Schema/HasAnyOf/Direct/original.json
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,11 @@ | ||
[ | ||
{ | ||
"url": "https://localheinz.com", | ||
"type": "Website" | ||
}, | ||
"https://github.com/localheinz", | ||
{ | ||
"url": "https://twitter.com/localheinz", | ||
"type": "Twitter" | ||
} | ||
] |
22 changes: 22 additions & 0 deletions
22
...ture/SchemaNormalizer/NormalizeNormalizes/Data/IsArray/Schema/HasAnyOf/Direct/schema.json
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 @@ | ||
{ | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { | ||
"type": "string" | ||
}, | ||
"url": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...aNormalizer/NormalizeNormalizes/Data/IsArray/Schema/HasAnyOf/HasReference/normalized.json
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,11 @@ | ||
[ | ||
{ | ||
"type": "Website", | ||
"url": "https://localheinz.com" | ||
}, | ||
"https://github.com/localheinz", | ||
{ | ||
"type": "Twitter", | ||
"url": "https://twitter.com/localheinz" | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
...emaNormalizer/NormalizeNormalizes/Data/IsArray/Schema/HasAnyOf/HasReference/original.json
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,11 @@ | ||
[ | ||
{ | ||
"url": "https://localheinz.com", | ||
"type": "Website" | ||
}, | ||
"https://github.com/localheinz", | ||
{ | ||
"url": "https://twitter.com/localheinz", | ||
"type": "Twitter" | ||
} | ||
] |
33 changes: 33 additions & 0 deletions
33
...chemaNormalizer/NormalizeNormalizes/Data/IsArray/Schema/HasAnyOf/HasReference/schema.json
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,33 @@ | ||
{ | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/url" | ||
}, | ||
"definitions": { | ||
"url": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/url-object" | ||
}, | ||
{ | ||
"$ref": "#/definitions/url-string" | ||
} | ||
] | ||
}, | ||
"url-object": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { | ||
"type": "string" | ||
}, | ||
"url": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"url-string": { | ||
"type": "string" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ixture/SchemaNormalizer/NormalizeNormalizes/Data/IsObject/Schema/HasAnyOf/normalized.json
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,8 @@ | ||
{ | ||
"name": "Andreas Möller", | ||
"urls": [ | ||
"https://localheinz.com", | ||
"https://github.com/localheinz", | ||
"https://twitter.com/localheinz" | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
.../Fixture/SchemaNormalizer/NormalizeNormalizes/Data/IsObject/Schema/HasAnyOf/original.json
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,8 @@ | ||
{ | ||
"urls": [ | ||
"https://localheinz.com", | ||
"https://github.com/localheinz", | ||
"https://twitter.com/localheinz" | ||
], | ||
"name": "Andreas Möller" | ||
} |
31 changes: 31 additions & 0 deletions
31
test/Fixture/SchemaNormalizer/NormalizeNormalizes/Data/IsObject/Schema/HasAnyOf/schema.json
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,31 @@ | ||
{ | ||
"anyOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"urls": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"url": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |