-
Notifications
You must be signed in to change notification settings - Fork 5
/
yaml-schema.yaml
119 lines (110 loc) · 6.58 KB
/
yaml-schema.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
"$schema": "https://json-schema.org/draft/2020-12"
type: object
definitions:
uri:
type: string
simpler-pattern: "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"
pattern: "^([A-Za-z]([A-Za-z0-9]|\\+|\\-|\\.)*)\\:(//(((([-A-Z._a-z0-9]|~)|%[0-9A-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:)*)@)?((\\[((([0-9A-Fa-f]{1,4}\\:){6}(([0-9A-Fa-f]{1,4}\\:[0-9A-Fa-f]{1,4})|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|\\:\\:([0-9A-Fa-f]{1,4}\\:){5}(([0-9A-Fa-f]{1,4}\\:[0-9A-Fa-f]{1,4})|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[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-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:|@)+(/(([-A-Z._a-z0-9]|~)|%[0-9A-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:|@)*)*)?|(([-A-Z._a-z0-9]|~)|%[0-9A-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:|@)+(/(([-A-Z._a-z0-9]|~)|%[0-9A-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:|@)*)*|MISSING-0(([-A-Z._a-z0-9]|~)|%[0-9A-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:|@))(\\?(((([-A-Z._a-z0-9]|~)|%[0-9A-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:|@)|/|\\?)*))?(#(((([-A-Z._a-z0-9]|~)|%[0-9A-Fa-f][0-9A-Fa-f]|(\\!|\\$|&|'|\\(|\\)|\\*|\\+|,|;|\\=)|\\:|@)|/|\\?)*))?$"
lang:
type: string
pattern: "^[a-zA-Z]{2,3}(-[a-zA-Z]{3}){0,3}|[a-zA-Z]{4,8}(-[a-zA-Z]{4})?(-[a-zA-Z]{2}|[0-9]{3})?(-[a-zA-Z]{5,8}|[0-9][a-zA-Z0-9]{3})*(-[0-9A-WY-Za-wy-z](-[a-zA-Z0-9]{2,8})+)*(-x(-[a-zA-Z0-9]{1,8})+)?|x(-[a-zA-Z0-9]{1,8})+|en-GB-oed|i-(ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)|sgn-(BE-(FR|NL)|CH-DE)$"
uris:
type: array
items:
"$ref": "#/definitions/uri"
card:
type: object
patternProperties:
"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$":
type: string
pattern: "^{[01]:[1M]}$"
additionalProperties: false
properties:
type:
type: string
pattern: "^(structure|enumeration|calendar|month|data type|uri|enumeration set)$"
lang:
type: string
uri:
"$ref": "#/definitions/uri"
enumeration set:
"$ref": "#/definitions/uri"
standard tag:
type: string
pattern: "^[A-Z0-9_]+$"
extension tags:
type: array
items:
type: string
pattern: "^_[A-Z0-9_]+$"
payload:
type: ["null", string]
pattern: "^Y\\|<NULL>$|^@<^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?>@$|^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"
documentation:
"$ref": "#/definitions/uris"
enumeration values:
"$ref": "#/definitions/uris"
calendars:
"$ref": "#/definitions/uris"
months:
"$ref": "#/definitions/uris"
epochs:
type: array
items:
type: string
pattern: "^(BCE|_[A-Z0-9_]+)$"
value of:
"$ref": "#/definitions/uris"
specification:
type: array
items:
type: string
label:
type: string
help text:
type: string
substructures:
"$ref": "#/definitions/card"
superstructures:
"$ref": "#/definitions/card"
subsumes:
"$ref": "#/definitions/uris"
contact:
type: string
additionalProperties: false
required:
- type
- lang
- uri
allOf:
- if: {properties: {type: {const: structure}}}
then: {required: [substructures, superstructures, payload, specification]}
- if: {properties: {type: {const: enumeration}}}
then: {required: [specification, value of]}
- if: {properties: {type: {const: calendar}}}
then: {required: [specification, months, epochs]}
- if: {properties: {type: {const: month}}}
then: {required: [calendars]}
- if: {properties: {type: {const: data type}}}
then: {required: [specification]}
- if: {properties: {type: {const: uri}}}
then: {required: [specification]}
- if: {properties: {type: {const: enumeration set}}}
then: {required: [enumeration values]}
- if:
properties:
type: {const: structure}
payload:
type: string
pattern: '^https://gedcom.io/terms/v7/type-(List#)?Enum$'
then: {required: [enumeration set]}
else: {not: {required: [enumeration set]}}
- if:
properties:
type:
pattern: "^(structure|enumeration|calendar|month)$"
then:
oneOf:
- {required: [standard tag]}
- {required: [extension tags]}