forked from oxidecomputer/typify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle redundant types with $ref; handle untagged enum full name conf…
…licts (oxidecomputer#200)
- Loading branch information
Showing
8 changed files
with
157 additions
and
31 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,32 +1,46 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "IdOrName", | ||
"oneOf": [ | ||
{ | ||
"title": "Id", | ||
"allOf": [ | ||
"definitions": { | ||
"IdOrName": { | ||
"oneOf": [ | ||
{ | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Name", | ||
"allOf": [ | ||
"title": "Id", | ||
"allOf": [ | ||
{ | ||
"type": "string", | ||
"format": "uuid" | ||
} | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/Name" | ||
"title": "Name", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Name" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"definitions": { | ||
}, | ||
"Name": { | ||
"title": "A name unique within the parent collection", | ||
"description": "Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end with a '-'. Names cannot be a UUID though they may contain a UUID.", | ||
"type": "string", | ||
"pattern": "^(?![0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)^[a-z][a-z0-9-]*[a-zA-Z0-9]$", | ||
"maxLength": 63 | ||
}, | ||
"IdOrNameRedundant": { | ||
"$comment": "tests references that include a redundant type field", | ||
"oneOf": [ | ||
{ | ||
"type": "string", | ||
"format": "uuid" | ||
}, | ||
{ | ||
"type": "string", | ||
"$ref": "#/definitions/Name" | ||
} | ||
] | ||
} | ||
} | ||
} |
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