metadata_presenter 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/default_metadata/config/meta.json +24 -0
- data/default_metadata/config/service.json +7 -0
- data/default_metadata/page/confirmation.json +4 -0
- data/default_metadata/page/summary.json +6 -0
- data/default_metadata/service/base.json +18 -0
- data/default_metadata/string/error.max_length.json +6 -0
- data/default_metadata/string/error.min_length.json +6 -0
- data/default_metadata/string/error.required.json +7 -0
- data/{lib/fixtures → fixtures}/non_finished_service.json +0 -0
- data/{lib/fixtures → fixtures}/service.json +0 -0
- data/{lib/fixtures → fixtures}/version.json +0 -0
- data/lib/metadata_presenter/engine.rb +0 -5
- data/lib/metadata_presenter/version.rb +1 -1
- data/schemas/condition/condition.json +48 -0
- data/schemas/config/meta.json +27 -0
- data/schemas/config/service.json +106 -0
- data/schemas/definition/block.json +28 -0
- data/schemas/definition/component.json +13 -0
- data/schemas/definition/components.json +15 -0
- data/schemas/definition/condition.base.json +25 -0
- data/schemas/definition/condition.boolean.json +25 -0
- data/schemas/definition/condition.defined.json +25 -0
- data/schemas/definition/condition.expression.json +22 -0
- data/schemas/definition/condition.number.json +49 -0
- data/schemas/definition/condition.text.json +48 -0
- data/schemas/definition/condition.value_type.json +24 -0
- data/schemas/definition/conditional.boolean.json +20 -0
- data/schemas/definition/conditions.all.json +20 -0
- data/schemas/definition/conditions.any.json +26 -0
- data/schemas/definition/conditions.exactly.json +26 -0
- data/schemas/definition/control.json +75 -0
- data/schemas/definition/data.json +28 -0
- data/schemas/definition/field.json +26 -0
- data/schemas/definition/html_attributes.json +37 -0
- data/schemas/definition/label.json +30 -0
- data/schemas/definition/link_list.json +30 -0
- data/schemas/definition/name.json +18 -0
- data/schemas/definition/namespace.json +28 -0
- data/schemas/definition/next_page.json +40 -0
- data/schemas/definition/page.content.json +23 -0
- data/schemas/definition/page.form.json +96 -0
- data/schemas/definition/page.json +109 -0
- data/schemas/definition/page.singlequestion.json +31 -0
- data/schemas/definition/repeatable.json +72 -0
- data/schemas/definition/width_class.input.json +48 -0
- data/schemas/definition/width_class.json +34 -0
- data/schemas/errors/errors.json +139 -0
- data/schemas/link/link.json +46 -0
- data/schemas/page/confirmation.json +35 -0
- data/schemas/page/start.json +34 -0
- data/schemas/page/summary.json +63 -0
- data/schemas/request/services.json +48 -0
- data/schemas/request/versions.json +13 -0
- data/schemas/service/base.json +53 -0
- data/schemas/service/configuration.json +22 -0
- data/schemas/service/locale.json +12 -0
- data/schemas/text/text.json +23 -0
- data/schemas/validations/validations.json +443 -0
- metadata +57 -4
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/condition/expression",
|
3
|
+
"_name": "definition.condition.expression",
|
4
|
+
"title": "Single expression condition properties",
|
5
|
+
"oneOf": [
|
6
|
+
{
|
7
|
+
"$ref": "definition.condition.defined"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"$ref": "definition.condition.text"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"$ref": "definition.condition.number"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"$ref": "definition.condition.boolean"
|
17
|
+
}
|
18
|
+
],
|
19
|
+
"category": [
|
20
|
+
"definition"
|
21
|
+
]
|
22
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/condition/number",
|
3
|
+
"_name": "definition.condition.number",
|
4
|
+
"title": "Number condition properties",
|
5
|
+
"allOf": [
|
6
|
+
{
|
7
|
+
"$ref": "definition.condition.base"
|
8
|
+
}
|
9
|
+
],
|
10
|
+
"properties": {
|
11
|
+
"operator": {
|
12
|
+
"title": "Operator",
|
13
|
+
"type": "string",
|
14
|
+
"enum": [
|
15
|
+
"equals",
|
16
|
+
"greater_than",
|
17
|
+
"greater_than_or_equal_to",
|
18
|
+
"less_than",
|
19
|
+
"less_than_or_equal_to",
|
20
|
+
"multiple_of"
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"value": {
|
24
|
+
"title": "Value"
|
25
|
+
}
|
26
|
+
},
|
27
|
+
"if": {
|
28
|
+
"required": [
|
29
|
+
"value_type"
|
30
|
+
]
|
31
|
+
},
|
32
|
+
"then": {
|
33
|
+
"$ref": "definition.condition.value_type"
|
34
|
+
},
|
35
|
+
"else": {
|
36
|
+
"properties": {
|
37
|
+
"value": {
|
38
|
+
"type": "number"
|
39
|
+
}
|
40
|
+
}
|
41
|
+
},
|
42
|
+
"required": [
|
43
|
+
"operator",
|
44
|
+
"value"
|
45
|
+
],
|
46
|
+
"category": [
|
47
|
+
"definition"
|
48
|
+
]
|
49
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/condition/text",
|
3
|
+
"_name": "definition.condition.text",
|
4
|
+
"title": "Text condition properties",
|
5
|
+
"allOf": [
|
6
|
+
{
|
7
|
+
"$ref": "definition.condition.base"
|
8
|
+
}
|
9
|
+
],
|
10
|
+
"properties": {
|
11
|
+
"operator": {
|
12
|
+
"title": "Operator",
|
13
|
+
"type": "string",
|
14
|
+
"enum": [
|
15
|
+
"is",
|
16
|
+
"starts_with",
|
17
|
+
"ends_with",
|
18
|
+
"includes",
|
19
|
+
"match"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"value": {
|
23
|
+
"title": "Value"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"if": {
|
27
|
+
"required": [
|
28
|
+
"value_type"
|
29
|
+
]
|
30
|
+
},
|
31
|
+
"then": {
|
32
|
+
"$ref": "definition.condition.value_type"
|
33
|
+
},
|
34
|
+
"else": {
|
35
|
+
"properties": {
|
36
|
+
"value": {
|
37
|
+
"type": "string"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"required": [
|
42
|
+
"operator",
|
43
|
+
"value"
|
44
|
+
],
|
45
|
+
"category": [
|
46
|
+
"definition"
|
47
|
+
]
|
48
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/condition/value_type",
|
3
|
+
"_name": "definition.condition.value_type",
|
4
|
+
"title": "Condition value type properties",
|
5
|
+
"properties": {
|
6
|
+
"value": {
|
7
|
+
"type": "string"
|
8
|
+
},
|
9
|
+
"value_type": {
|
10
|
+
"type": "string",
|
11
|
+
"enum": [
|
12
|
+
"value",
|
13
|
+
"input",
|
14
|
+
"feature"
|
15
|
+
]
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"required": [
|
19
|
+
"value_type"
|
20
|
+
],
|
21
|
+
"category": [
|
22
|
+
"definition"
|
23
|
+
]
|
24
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/conditional/boolean",
|
3
|
+
"_name": "definition.conditional.boolean",
|
4
|
+
"title": "Boolean or condition",
|
5
|
+
"type": [
|
6
|
+
"boolean",
|
7
|
+
"object"
|
8
|
+
],
|
9
|
+
"oneOf": [
|
10
|
+
{
|
11
|
+
"type": "boolean"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"$ref": "condition"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"category": [
|
18
|
+
"definition"
|
19
|
+
]
|
20
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/conditions/all",
|
3
|
+
"_name": "definition.conditions.all",
|
4
|
+
"title": "All conditions met properties",
|
5
|
+
"properties": {
|
6
|
+
"all": {
|
7
|
+
"title": "All conditions met",
|
8
|
+
"type": "array",
|
9
|
+
"items": {
|
10
|
+
"$ref": "condition"
|
11
|
+
}
|
12
|
+
}
|
13
|
+
},
|
14
|
+
"required": [
|
15
|
+
"all"
|
16
|
+
],
|
17
|
+
"category": [
|
18
|
+
"definition"
|
19
|
+
]
|
20
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/conditions/any",
|
3
|
+
"_name": "definition.conditions.any",
|
4
|
+
"title": "At least conditions met properties",
|
5
|
+
"properties": {
|
6
|
+
"any": {
|
7
|
+
"title": "At least X conditions met",
|
8
|
+
"type": "array",
|
9
|
+
"items": {
|
10
|
+
"$ref": "condition"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"conditions_met": {
|
14
|
+
"title": "Number of conditions to meet",
|
15
|
+
"type": "number",
|
16
|
+
"minimum": 1,
|
17
|
+
"default": 1
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"required": [
|
21
|
+
"any"
|
22
|
+
],
|
23
|
+
"category": [
|
24
|
+
"definition"
|
25
|
+
]
|
26
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/conditions/exactly",
|
3
|
+
"_name": "definition.conditions.exactly",
|
4
|
+
"title": "Exactly conditions met properties",
|
5
|
+
"properties": {
|
6
|
+
"exactly": {
|
7
|
+
"title": "Exactly X conditions met",
|
8
|
+
"type": "array",
|
9
|
+
"items": {
|
10
|
+
"$ref": "condition"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"conditions_met": {
|
14
|
+
"title": "Number of conditions to meet",
|
15
|
+
"type": "number",
|
16
|
+
"minimum": 1,
|
17
|
+
"default": 1
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"required": [
|
21
|
+
"exactly"
|
22
|
+
],
|
23
|
+
"category": [
|
24
|
+
"definition"
|
25
|
+
]
|
26
|
+
}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/control",
|
3
|
+
"_name": "definition.control",
|
4
|
+
"title": "Control definition",
|
5
|
+
"allOf": [
|
6
|
+
{
|
7
|
+
"$ref": "definition.component"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"$ref": "definition.html_attributes"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"$ref": "definition.namespace"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"$ref": "validations#/definitions/required_bundle"
|
17
|
+
}
|
18
|
+
],
|
19
|
+
"properties": {
|
20
|
+
"redact": {
|
21
|
+
"title": "Redaction pattern",
|
22
|
+
"description": "Pattern specifying that user input should be redacted and how",
|
23
|
+
"type": "string",
|
24
|
+
"category": [
|
25
|
+
"userinput"
|
26
|
+
]
|
27
|
+
},
|
28
|
+
"optionalText": {
|
29
|
+
"title": "Optional text",
|
30
|
+
"description": "Additional text to display if control is optional",
|
31
|
+
"type": "string",
|
32
|
+
"category": [
|
33
|
+
"content"
|
34
|
+
],
|
35
|
+
"acceptsEmptyString": true,
|
36
|
+
"default": "(optional)"
|
37
|
+
},
|
38
|
+
"autocomplete": {
|
39
|
+
"title": "Autocomplete",
|
40
|
+
"description": "Instructions how to suggest (or not) values",
|
41
|
+
"type": "string",
|
42
|
+
"category": [
|
43
|
+
"userinput"
|
44
|
+
]
|
45
|
+
},
|
46
|
+
"spellcheck": {
|
47
|
+
"title": "Spellcheck",
|
48
|
+
"description": "Whether the element may be checked for spelling errors",
|
49
|
+
"type": "string",
|
50
|
+
"enum": [
|
51
|
+
"true",
|
52
|
+
"false"
|
53
|
+
],
|
54
|
+
"category": [
|
55
|
+
"userinput"
|
56
|
+
]
|
57
|
+
},
|
58
|
+
"disabled": {
|
59
|
+
"title": "Disabled",
|
60
|
+
"description": "Whether the control should be disabled",
|
61
|
+
"oneOf": [
|
62
|
+
{
|
63
|
+
"$ref": "definition.conditional.boolean"
|
64
|
+
}
|
65
|
+
],
|
66
|
+
"default": false,
|
67
|
+
"category": [
|
68
|
+
"logic"
|
69
|
+
]
|
70
|
+
}
|
71
|
+
},
|
72
|
+
"category": [
|
73
|
+
"control"
|
74
|
+
]
|
75
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/data",
|
3
|
+
"_name": "definition.data",
|
4
|
+
"title": "Data definition",
|
5
|
+
"properties": {
|
6
|
+
"_id": {
|
7
|
+
"title": "Data ID",
|
8
|
+
"type": "string"
|
9
|
+
},
|
10
|
+
"_type": {
|
11
|
+
"title": "Data type",
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
"_isa": {
|
15
|
+
"title": "Based on",
|
16
|
+
"description": "Id of page/component to inherit property values from",
|
17
|
+
"type": "string",
|
18
|
+
"blockReference": true
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"required": [
|
22
|
+
"_id",
|
23
|
+
"_type"
|
24
|
+
],
|
25
|
+
"category": [
|
26
|
+
"definition"
|
27
|
+
]
|
28
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/field",
|
3
|
+
"_name": "definition.field",
|
4
|
+
"title": "Field definition",
|
5
|
+
"allOf": [
|
6
|
+
{
|
7
|
+
"$ref": "definition.label"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"$ref": "definition.control"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"$ref": "definition.repeatable"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"$ref": "definition.name"
|
17
|
+
}
|
18
|
+
],
|
19
|
+
"required": [
|
20
|
+
"name",
|
21
|
+
"label"
|
22
|
+
],
|
23
|
+
"category": [
|
24
|
+
"field"
|
25
|
+
]
|
26
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/html_attributes",
|
3
|
+
"_name": "definition.html_attributes",
|
4
|
+
"title": "HTML attributes definition",
|
5
|
+
"description": "Additional HTML values to set on instances",
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"id": {
|
9
|
+
"title": "HTML id",
|
10
|
+
"description": "Additional HTML id to apply to instance - only use as a last resort, to target a specific element on the page",
|
11
|
+
"type": "string",
|
12
|
+
"category": [
|
13
|
+
"html_attributes"
|
14
|
+
]
|
15
|
+
},
|
16
|
+
"classes": {
|
17
|
+
"title": "Classes",
|
18
|
+
"description": "Additional HTML classes to apply to instance - to add more than one, separate with a space",
|
19
|
+
"type": "string",
|
20
|
+
"content": true,
|
21
|
+
"category": [
|
22
|
+
"html_attributes"
|
23
|
+
]
|
24
|
+
},
|
25
|
+
"attributes": {
|
26
|
+
"title": "Attributes",
|
27
|
+
"description": "Additional HTML attributes to apply to instance - Enter the attributes as JSON",
|
28
|
+
"type": "object",
|
29
|
+
"category": [
|
30
|
+
"html_attributes"
|
31
|
+
]
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"category": [
|
35
|
+
"definition"
|
36
|
+
]
|
37
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"$id": "http://gov.uk/schema/v1.0.0/definition/label",
|
3
|
+
"_name": "definition.label",
|
4
|
+
"title": "Label definition",
|
5
|
+
"type": "object",
|
6
|
+
"properties": {
|
7
|
+
"label": {
|
8
|
+
"title": "Label",
|
9
|
+
"description": "Question or instruction to user - appears above the component. If component is repeatable, the label appears next to the input, with the number added automatically (for example, child 1)",
|
10
|
+
"type": "string",
|
11
|
+
"content": true
|
12
|
+
},
|
13
|
+
"hint": {
|
14
|
+
"title": "Hint text",
|
15
|
+
"description": "Text to help users answer a question - appears in grey under the label (like this text)",
|
16
|
+
"type": "string",
|
17
|
+
"multiline": true,
|
18
|
+
"content": true
|
19
|
+
},
|
20
|
+
"label_summary": {
|
21
|
+
"title": "Label (Summary version)",
|
22
|
+
"description": "The text used on the 'check your answers' page. Ideally a shorter version of the label text",
|
23
|
+
"type": "string",
|
24
|
+
"content": true
|
25
|
+
}
|
26
|
+
},
|
27
|
+
"category": [
|
28
|
+
"definition"
|
29
|
+
]
|
30
|
+
}
|