FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
jsonscript/schema/schema.json.dot at master · JSONScript/jsonscript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
JSONScript
/
jsonscript
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
57
Code
Issues
3
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
jsonscript
/
schema
/
schema.json.dot
Copy path
More file actions
More file actions
Latest commit
History
History
History
93 lines (93 loc) · 3.05 KB
Breadcrumbs
jsonscript
/
schema
/
schema.json.dot
Copy path
File metadata and controls
93 lines (93 loc) · 3.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
{
"
id
"
:
"
http://www.jsonscript.org/schema/schema{{?it.strictSchema}}_strict{{?}}.json#
"
,
"
$schema
"
:
"
https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#
"
,
"
title
"
:
"
JSONScript schema
"
,
"
description
"
:
"
JSONScript script with instructions (generated from template)
"
,
"
anyOf
"
: [
{{~ it.instructions:inst }}
{
"
$ref
"
:
"
#{{=inst.name}}
"
},
{{~}}
{{~ it.macros:macro }}
{{~ macro.rules:rule:i }}
{
"
$ref
"
:
"
#macro_{{=macro.name}}_{{=i}}
"
},
{{~}}
{{~}}
{
"
$ref
"
:
"
#parallel
"
},
{
"
$ref
"
:
"
#sequential
"
},
{
"
$ref
"
:
"
#scalar
"
}
],
"
definitions
"
: {
{{~ it.instructions:inst }}
"
_{{=inst.name}}
"
: {
"
id
"
:
"
#{{=inst.name}}
"
,
"
title
"
:
"
{{=inst.name}}
"
,
"
description
"
:
"
{{=inst.description}}
"
,
"
type
"
:
"
object
"
,
"
properties
"
: {
{{~ inst.keywords:keyword:i }}
{{?i}},{{?}}
{{
var keywordSch = inst.schema && inst.schema[keyword]
, validateScalarType = it.strictSchema && keywordSch && typeof keywordSch.type == 'string' &&
['string', 'number', 'integer', 'boolean', 'null'].indexOf(keywordSch.type) >= 0;
}}
{{? validateScalarType }}
"
{{=keyword}}
"
: {
"
anyOf
"
: [
{{= JSON.stringify(inst.schema[keyword]) }},
{
"
allOf
"
: [
{
"
type
"
: [
"
object
"
,
"
array
"
] },
{
"
$ref
"
:
"
#
"
}
]
}
]
}
{{??}}
"
{{=keyword}}
"
: {
"
$ref
"
:
"
#
"
}
{{?}}
{{~}}
},
"
additionalProperties
"
: false,
"
required
"
: {{= JSON.stringify(inst.required) }}
},
{{~}}
{{~ it.macros:macro }}
{{~ macro.rules:rule:i }}
{{ var patternKey = Object.keys(rule.pattern)[0].replace(/\\/g, '\\\\'); }}
"
_macro_{{=macro.name}}_{{=i}}
"
: {
"
id
"
:
"
#macro_{{=macro.name}}_{{=i}}
"
,
"
description
"
:
"
{{=macro.description}}
"
,
"
type
"
:
"
object
"
,
"
patternProperties
"
: {
"
{{= patternKey }}
"
: {
"
$ref
"
:
"
#
"
}
},
"
maxProperties
"
: 1,
"
minProperties
"
: 1,
"
additionalProperties
"
: false,
"
patternRequired
"
: [
"
{{= patternKey }}
"
]
},
{{~}}
{{~}}
"
parallel
"
: {
"
id
"
:
"
#parallel
"
,
"
description
"
:
"
scripts in the object are executed in parallel, property names should not start with $
"
,
"
type
"
:
"
object
"
,
"
patternProperties
"
: {
"
^[^$]
"
: {
"
$ref
"
:
"
#
"
}
},
"
additionalProperties
"
: false
},
"
sequential
"
: {
"
id
"
:
"
#sequential
"
,
"
description
"
:
"
scripts in array are executed sequentially
"
,
"
type
"
:
"
array
"
,
"
items
"
: {
"
$ref
"
:
"
#
"
}
},
"
scalar
"
: {
"
id
"
:
"
#scalar
"
,
"
description
"
:
"
scalar values are also valid JSONScript
"
,
"
type
"
: [
"
string
"
,
"
number
"
,
"
integer
"
,
"
boolean
"
,
"
null
"
]
}
}
}
Back
|
FazBrowse Home
|
New Git URL