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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/default_metadata/config/meta.json +24 -0
  3. data/default_metadata/config/service.json +7 -0
  4. data/default_metadata/page/confirmation.json +4 -0
  5. data/default_metadata/page/summary.json +6 -0
  6. data/default_metadata/service/base.json +18 -0
  7. data/default_metadata/string/error.max_length.json +6 -0
  8. data/default_metadata/string/error.min_length.json +6 -0
  9. data/default_metadata/string/error.required.json +7 -0
  10. data/{lib/fixtures → fixtures}/non_finished_service.json +0 -0
  11. data/{lib/fixtures → fixtures}/service.json +0 -0
  12. data/{lib/fixtures → fixtures}/version.json +0 -0
  13. data/lib/metadata_presenter/engine.rb +0 -5
  14. data/lib/metadata_presenter/version.rb +1 -1
  15. data/schemas/condition/condition.json +48 -0
  16. data/schemas/config/meta.json +27 -0
  17. data/schemas/config/service.json +106 -0
  18. data/schemas/definition/block.json +28 -0
  19. data/schemas/definition/component.json +13 -0
  20. data/schemas/definition/components.json +15 -0
  21. data/schemas/definition/condition.base.json +25 -0
  22. data/schemas/definition/condition.boolean.json +25 -0
  23. data/schemas/definition/condition.defined.json +25 -0
  24. data/schemas/definition/condition.expression.json +22 -0
  25. data/schemas/definition/condition.number.json +49 -0
  26. data/schemas/definition/condition.text.json +48 -0
  27. data/schemas/definition/condition.value_type.json +24 -0
  28. data/schemas/definition/conditional.boolean.json +20 -0
  29. data/schemas/definition/conditions.all.json +20 -0
  30. data/schemas/definition/conditions.any.json +26 -0
  31. data/schemas/definition/conditions.exactly.json +26 -0
  32. data/schemas/definition/control.json +75 -0
  33. data/schemas/definition/data.json +28 -0
  34. data/schemas/definition/field.json +26 -0
  35. data/schemas/definition/html_attributes.json +37 -0
  36. data/schemas/definition/label.json +30 -0
  37. data/schemas/definition/link_list.json +30 -0
  38. data/schemas/definition/name.json +18 -0
  39. data/schemas/definition/namespace.json +28 -0
  40. data/schemas/definition/next_page.json +40 -0
  41. data/schemas/definition/page.content.json +23 -0
  42. data/schemas/definition/page.form.json +96 -0
  43. data/schemas/definition/page.json +109 -0
  44. data/schemas/definition/page.singlequestion.json +31 -0
  45. data/schemas/definition/repeatable.json +72 -0
  46. data/schemas/definition/width_class.input.json +48 -0
  47. data/schemas/definition/width_class.json +34 -0
  48. data/schemas/errors/errors.json +139 -0
  49. data/schemas/link/link.json +46 -0
  50. data/schemas/page/confirmation.json +35 -0
  51. data/schemas/page/start.json +34 -0
  52. data/schemas/page/summary.json +63 -0
  53. data/schemas/request/services.json +48 -0
  54. data/schemas/request/versions.json +13 -0
  55. data/schemas/service/base.json +53 -0
  56. data/schemas/service/configuration.json +22 -0
  57. data/schemas/service/locale.json +12 -0
  58. data/schemas/text/text.json +23 -0
  59. data/schemas/validations/validations.json +443 -0
  60. metadata +57 -4
@@ -0,0 +1,48 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/width_class/input",
3
+ "_name": "definition.width_class.input",
4
+ "title": "Input width class definition",
5
+ "properties": {
6
+ "width_class_input": {
7
+ "title": "Input width",
8
+ "description": "How wide the input should be visually",
9
+ "type": "string",
10
+ "enum_map": {
11
+ "2": "2 characters",
12
+ "3": "3 characters",
13
+ "4": "4 characters",
14
+ "5": "5 characters",
15
+ "10": "10 characters",
16
+ "20": "20 characters",
17
+ "30": "30 characters",
18
+ "one-quarter": "One quarter",
19
+ "one-third": "One third",
20
+ "one-half": "One half",
21
+ "two-thirds": "Two thirds",
22
+ "three-quarters": "Three quarters",
23
+ "full": "Full width"
24
+ },
25
+ "enum": [
26
+ "2",
27
+ "3",
28
+ "4",
29
+ "5",
30
+ "10",
31
+ "20",
32
+ "30",
33
+ "one-quarter",
34
+ "one-third",
35
+ "one-half",
36
+ "two-thirds",
37
+ "three-quarters",
38
+ "full"
39
+ ],
40
+ "category": [
41
+ "html_attributes"
42
+ ]
43
+ }
44
+ },
45
+ "category": [
46
+ "definition"
47
+ ]
48
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/width_class",
3
+ "_name": "definition.width_class",
4
+ "title": "Width class definition",
5
+ "properties": {
6
+ "width_class": {
7
+ "title": "Width",
8
+ "description": "How wide the component should be visually",
9
+ "type": "string",
10
+ "enum_map": {
11
+ "one-quarter": "One quarter",
12
+ "one-third": "One third",
13
+ "one-half": "One half",
14
+ "two-thirds": "Two thirds",
15
+ "three-quarters": "Three quarters",
16
+ "full": "Full width"
17
+ },
18
+ "enum": [
19
+ "one-quarter",
20
+ "one-third",
21
+ "one-half",
22
+ "two-thirds",
23
+ "three-quarters",
24
+ "full"
25
+ ],
26
+ "category": [
27
+ "html_attributes"
28
+ ]
29
+ }
30
+ },
31
+ "category": [
32
+ "definition"
33
+ ]
34
+ }
@@ -0,0 +1,139 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/errors",
3
+ "_name": "errors",
4
+ "title": "Error strings",
5
+ "type": "object",
6
+ "definitions": {
7
+ "error_strings": {
8
+ "type": "object",
9
+ "properties": {
10
+ "any": {
11
+ "type": "string"
12
+ }
13
+ }
14
+ },
15
+ "required": {
16
+ "title": "Error strings for required",
17
+ "allOf": [
18
+ {
19
+ "$ref": "#/definitions/error_strings"
20
+ }
21
+ ]
22
+ },
23
+ "min_length": {
24
+ "title": "Error strings for minimum length",
25
+ "allOf": [
26
+ {
27
+ "$ref": "#/definitions/error_strings"
28
+ }
29
+ ]
30
+ },
31
+ "max_length": {
32
+ "title": "Error strings for maximum length",
33
+ "allOf": [
34
+ {
35
+ "$ref": "#/definitions/error_strings"
36
+ }
37
+ ]
38
+ },
39
+ "pattern": {
40
+ "title": "Error strings for pattern",
41
+ "allOf": [
42
+ {
43
+ "$ref": "#/definitions/error_strings"
44
+ }
45
+ ]
46
+ },
47
+ "multiple_of": {
48
+ "title": "Error strings for multiple of",
49
+ "allOf": [
50
+ {
51
+ "$ref": "#/definitions/error_strings"
52
+ }
53
+ ]
54
+ },
55
+ "maximum": {
56
+ "title": "Error strings for maximum",
57
+ "allOf": [
58
+ {
59
+ "$ref": "#/definitions/error_strings"
60
+ }
61
+ ]
62
+ },
63
+ "exclusive_maximum": {
64
+ "title": "Error strings for exclusive maximum",
65
+ "allOf": [
66
+ {
67
+ "$ref": "#/definitions/error_strings"
68
+ }
69
+ ]
70
+ },
71
+ "minimum": {
72
+ "title": "Error strings for minimum",
73
+ "allOf": [
74
+ {
75
+ "$ref": "#/definitions/error_strings"
76
+ }
77
+ ]
78
+ },
79
+ "exclusive_minimum": {
80
+ "title": "Error strings for exclusive minimum",
81
+ "allOf": [
82
+ {
83
+ "$ref": "#/definitions/error_strings"
84
+ }
85
+ ]
86
+ },
87
+ "required_errors": {
88
+ "properties": {
89
+ "errors": {
90
+ "properties": {
91
+ "required": {
92
+ "$ref": "#/definitions/required"
93
+ }
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "string_errors": {
99
+ "properties": {
100
+ "errors": {
101
+ "properties": {
102
+ "min_length": {
103
+ "$ref": "#/definitions/min_length"
104
+ },
105
+ "max_length": {
106
+ "$ref": "#/definitions/max_length"
107
+ },
108
+ "pattern": {
109
+ "$ref": "#/definitions/pattern"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "number_errors": {
116
+ "properties": {
117
+ "errors": {
118
+ "properties": {
119
+ "multiple_of": {
120
+ "$ref": "#/definitions/multiple_of"
121
+ },
122
+ "maximum": {
123
+ "$ref": "#/definitions/maximum"
124
+ },
125
+ "exclusive_maximum": {
126
+ "$ref": "#/definitions/exclusive_maximum"
127
+ },
128
+ "minimum": {
129
+ "$ref": "#/definitions/minimum"
130
+ },
131
+ "exclusive_minimum": {
132
+ "$ref": "#/definitions/exclusive_minimum"
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/link",
3
+ "_name": "link",
4
+ "title": "Link",
5
+ "type": "object",
6
+ "properties": {
7
+ "_type": {
8
+ "const": "link"
9
+ },
10
+ "text": {
11
+ "title": "Link text",
12
+ "description": "Link text to display",
13
+ "type": "string",
14
+ "content": true
15
+ },
16
+ "href": {
17
+ "title": "Link url",
18
+ "description": "Page Id or absolute url",
19
+ "type": "string",
20
+ "content": true,
21
+ "url": true
22
+ },
23
+ "active": {
24
+ "title": "Active",
25
+ "description": "Whether link is active",
26
+ "type": "boolean"
27
+ },
28
+ "attributes": {
29
+ "title": "Link attributes",
30
+ "description": "Attributes to pass to link",
31
+ "type": "object"
32
+ }
33
+ },
34
+ "required": [
35
+ "text",
36
+ "href"
37
+ ],
38
+ "allOf": [
39
+ {
40
+ "$ref": "definition.block"
41
+ }
42
+ ],
43
+ "category": [
44
+ "definition"
45
+ ]
46
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/page/confirmation",
3
+ "_name": "page.confirmation",
4
+ "title": "Confirmation",
5
+ "description": "Confirm to users that they’ve completed their answers",
6
+ "type": "object",
7
+ "properties": {
8
+ "_id": {
9
+ "const": "page.confirmation"
10
+ },
11
+ "_type": {
12
+ "const": "page.confirmation"
13
+ },
14
+ "heading": {
15
+ "multiline": true
16
+ },
17
+ "body": {
18
+ "multiline": true
19
+ },
20
+ "lede": {
21
+ "multiline": true
22
+ }
23
+ },
24
+ "required": [
25
+ "_id",
26
+ "_type",
27
+ "heading"
28
+ ],
29
+ "additionalProperties": false,
30
+ "allOf": [
31
+ {
32
+ "$ref": "definition.page.content"
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/page/start",
3
+ "_name": "page.start",
4
+ "title": "Start page",
5
+ "description": "Let users start using a service",
6
+ "type": "object",
7
+ "properties": {
8
+ "_type": {
9
+ "const": "page.start"
10
+ },
11
+ "enable_steps": {
12
+ "const": true
13
+ },
14
+ "components": {
15
+ "accepts": [
16
+ "content"
17
+ ]
18
+ }
19
+ },
20
+ "allOf": [
21
+ {
22
+ "$ref": "definition.page.form"
23
+ }
24
+ ],
25
+ "ui_category": {
26
+ "main": [
27
+ "lede",
28
+ "body"
29
+ ]
30
+ },
31
+ "required": [
32
+ "steps"
33
+ ]
34
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/page/summary",
3
+ "_name": "page.summary",
4
+ "title": "Check answers",
5
+ "description": "Let users check and change their answers before submitting",
6
+ "type": "object",
7
+ "properties": {
8
+ "_type": {
9
+ "const": "page.summary"
10
+ },
11
+ "section_heading": {
12
+ "title": "Section heading",
13
+ "type": "string",
14
+ "description": "Section to display before the heading"
15
+ },
16
+ "heading": {
17
+ "type": "string",
18
+ "default": "Check your answers"
19
+ },
20
+ "lede": {
21
+ "title": "Lede",
22
+ "type": "string",
23
+ "description": "Content before the body"
24
+ },
25
+ "body": {
26
+ "title": "Body",
27
+ "type": "string",
28
+ "description": "Optional content before showing the summary"
29
+ },
30
+ "summary_of": {
31
+ "title": "Summary of",
32
+ "description": "Page/section that summary summarises"
33
+ },
34
+ "send_heading": {
35
+ "title": "Send heading",
36
+ "description": "Heading to display before accept and send button",
37
+ "type": "string",
38
+ "content": true,
39
+ "default": "Now send your application"
40
+ },
41
+ "send_body": {
42
+ "title": "Send content",
43
+ "description": "Content to display before accept and send button - use [markdown](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/markdown) to format text or add hyperlinks",
44
+ "type": "string",
45
+ "content": true,
46
+ "multiline": true,
47
+ "default": "By submitting this application you confirm that, to the best of your knowledge, the details you are providing are correct."
48
+ }
49
+ },
50
+ "required": [
51
+ "_id",
52
+ "_type",
53
+ "heading",
54
+ "send_heading",
55
+ "send_body"
56
+ ],
57
+ "additionalProperties": false,
58
+ "allOf": [
59
+ {
60
+ "$ref": "definition.page.form"
61
+ }
62
+ ]
63
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/request/services",
3
+ "_name": "request.services",
4
+ "title": "Create new service",
5
+ "description": "Request schema for creating a new service",
6
+ "type": "object",
7
+ "properties": {
8
+ "metadata": {
9
+ "type": "object",
10
+ "properties": {
11
+ "_id": {
12
+ "const": "service.base"
13
+ },
14
+ "_type": {
15
+ "const": "service.base"
16
+ },
17
+ "service_name": {
18
+ "type": "string"
19
+ },
20
+ "created_by": {
21
+ "type": "string"
22
+ },
23
+ "configuration": {
24
+ "$ref": "configuration"
25
+ },
26
+ "locale": {
27
+ "$ref": "service.locale"
28
+ },
29
+ "pages": {
30
+ "type": "array",
31
+ "items": {
32
+ "$ref": "definition.page"
33
+ }
34
+ }
35
+ },
36
+ "required": [
37
+ "_id",
38
+ "_type",
39
+ "service_name",
40
+ "created_by",
41
+ "configuration",
42
+ "pages"
43
+ ],
44
+ "additionalProperties": false
45
+ }
46
+ },
47
+ "required": ["metadata"]
48
+ }