-
Notifications
You must be signed in to change notification settings - Fork 149
/
simpletypes.schema.json
151 lines (151 loc) · 4.29 KB
/
simpletypes.schema.json
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
"meta:license": [
"Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
"This file is licensed to you under the Apache License, Version 2.0 (the 'License');",
"you may not use this file except in compliance with the License. You may obtain a copy",
"of the License at http://www.apache.org/licenses/LICENSE-2.0"
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://example.com/schemas/simpletypes",
"title": "Simple Types",
"type": "object",
"description": "This is an example schema with examples for multiple types and their constraints.",
"properties": {
"string_unconstrained": {
"type": "string",
"description": "A simple string, without any constraints.",
"examples": ["bar"],
"version": "1.0.0",
"testProperty": "test"
},
"string_length": {
"type": "string",
"description": "A string with minumum and maximum length",
"examples": ["bar", "baz"],
"minLength": 3,
"maxLength": 3,
"version": "1.0.0",
"testProperty": "test"
},
"string_pattern": {
"type": "string",
"description": "A string following a regular expression",
"pattern": "^ba.$",
"examples": ["bar", "baz", "bat"],
"meta:enum": {
"baa": "the sounds of sheeps",
"bad": "German bathroom",
"bag": "holding device",
"bah": "humbug!",
"bam": "a loud sound",
"ban": "don't do this",
"bap": "a British soft bread roll",
"bas": "from ancient Egyptian religion, an aspect of the soul",
"bat": "…out of hell",
"bay": ", sitting by the dock of the"
},
"version": "1.0.0",
"testProperty": "test"
},
"string_pattern_noexample": {
"type": "string",
"description": "A string following a regular expression",
"pattern": "^ba.$",
"version": "1.0.0",
"testProperty": "test"
},
"string_pattern_singleexample": {
"type": "string",
"description": "A string following a regular expression",
"pattern": "^ba.$",
"examples": ["bar"],
"version": "1.0.0",
"testProperty": "test"
},
"string_date": {
"type": "string",
"description": "A date-like string.",
"format": "date-time",
"version": "1.0.0",
"testProperty": "test"
},
"string_email": {
"type": "string",
"description": "An email-like string.",
"format": "email",
"version": "1.0.0",
"testProperty": "test"
},
"string_hostname": {
"type": "string",
"description": "A hostname-like string.",
"format": "hostname",
"version": "1.0.0",
"testProperty": "test"
},
"string_ipv4": {
"type": "string",
"description": "An IPv4-like string.",
"format": "ipv4",
"version": "1.0.0",
"testProperty": "test"
},
"string_ipv6": {
"type": "string",
"description": "An IPv6-like string.",
"format": "ipv6",
"version": "1.0.0",
"testProperty": "test"
},
"string_uri": {
"type": "string",
"description": "A URI.",
"format": "uri",
"version": "1.0.0",
"testProperty": "test"
},
"number_unconstrained": {
"type": "number",
"description": "Just a number",
"version": "1.0.0",
"testProperty": "test"
},
"interger_unconstrained": {
"type": "integer",
"description": "Just a whole number. I don't like fractions.",
"version": "1.0.0",
"testProperty": "test"
},
"interger_constrained": {
"type": "integer",
"description": "Just a whole number. I don't like fractions. Don't get too small",
"minimum": 10,
"version": "1.0.0",
"testProperty": "test"
},
"number_constrained": {
"type": "number",
"description": "Just a number. Don't get too big.",
"exclusiveMaximum": 10,
"version": "1.0.0",
"testProperty": "test"
},
"integer_threes": {
"type":"integer",
"description": "Guess what number is valid",
"multipleOf": 3,
"minimum": 2,
"maximum": 4,
"version": "1.0.0",
"testProperty": "test"
},
"yesno": {
"type": "boolean",
"version": "1.0.0",
"testProperty": "test"
}
},
"required": [
"yesno"
]
}