Merge in changes there were made since seeding
[dcaegen2/platform/cli.git] / component-json-schemas / data-format-schema.json
1 {
2     "$schema": "http://json-schema.org/draft-04/schema#",
3     "title": "Data format specification schema Version 1.0",
4     "type": "object",
5     "oneOf": [{
6         "properties": {
7             "self": {
8                 "$ref": "#/definitions/self"
9             },
10             "dataformatversion": {
11                 "$ref": "#/definitions/dataformatversion"
12             },
13             "reference": {
14
15                 "type": "object",
16                 "description": "A reference to an external schema - name/version is used to access the artifact",
17                 "properties": {
18                     "name": {
19                         "$ref": "#/definitions/name"
20                     },
21                     "version": {
22                         "$ref": "#/definitions/version"
23                     },
24                     "format": {
25                         "$ref": "#/definitions/format"
26                     }
27                 },
28                 "required": [
29                     "name",
30                     "version",
31                     "format"
32                 ],
33                 "additionalProperties": false
34             }
35         },
36         "required": ["self", "dataformatversion", "reference"],
37         "additionalProperties": false
38     }, {
39         "properties": {
40             "self": {
41                 "$ref": "#/definitions/self"
42             },
43             "dataformatversion": {
44                 "$ref": "#/definitions/dataformatversion"
45             },
46             "jsonschema": {
47                 "$schema": "http://json-schema.org/draft-04/schema#",
48                 "description": "The actual JSON schema for this data format"
49             }
50
51         },
52         "required": ["self", "dataformatversion", "jsonschema"],
53         "additionalProperties": false
54     }, {
55         "properties": {
56             "self": {
57                 "$ref": "#/definitions/self"
58             },
59             "dataformatversion": {
60                 "$ref": "#/definitions/dataformatversion"
61             },
62             "delimitedschema": {
63                 "type": "object",
64                 "description": "A JSON schema for delimited files",
65                 "properties": {
66                     "delimiter": {
67                         "enum": [",", "|", "\t"]
68                     },
69                     "fields": {
70                         "type": "array",
71                         "description": "Array of field descriptions",
72                         "items": {
73                             "$ref": "#/definitions/field"
74                         }
75                     }
76                 },
77                 "additionalProperties": false
78             }
79         },
80         "required": ["self", "dataformatversion", "delimitedschema"],
81         "additionalProperties": false
82     }, {
83         "properties": {
84             "self": {
85                 "$ref": "#/definitions/self"
86             },
87             "dataformatversion": {
88                 "$ref": "#/definitions/dataformatversion"
89             },
90             "unstructured": {
91                 "type": "object",
92                 "description": "A JSON schema for unstructured text",
93                 "properties": {
94                     "encoding": {
95                         "type": "string",
96                         "enum": ["ASCII", "UTF-8", "UTF-16", "UTF-32"]
97                     }
98                 },
99                 "additionalProperties": false
100
101             }
102         },
103         "required": ["self", "dataformatversion", "unstructured"],
104         "additionalProperties": false
105     }],
106     "definitions": {
107         "name": {
108             "type": "string"
109         },
110         "version": {
111             "type": "string",
112             "pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$"
113         },
114         "self": {
115             "description": "Identifying Information for the Data Format - name/version can be used to access the artifact",
116             "type": "object",
117             "properties": {
118                 "name": {
119                     "$ref": "#/definitions/name"
120                 },
121                 "version": {
122                     "$ref": "#/definitions/version"
123                 },
124                 "description": {
125                     "type": "string"
126                 }
127             },
128             "required": [
129                 "name",
130                 "version"
131             ],
132             "additionalProperties": false
133         },
134         "format": {
135             "description": "Reference schema type",
136             "type": "string",
137             "enum": [
138                 "JSON",
139                 "Delimited Format",
140                 "XML",
141                 "Unstructured"
142             ]
143         },
144         "field": {
145             "description": "A field definition for the delimited schema",
146             "type": "object",
147             "properties": {
148                 "name": {
149                     "type": "string"
150                 },
151                 "description": {
152                     "type": "string"
153                 },
154                 "fieldtype": {
155                     "description": "the field type - from the XML schema types",
156                     "type": "string",
157                     "enum": ["string", "boolean",
158                         "decimal", "float", "double",
159                         "duration", "dateTime", "time",
160                         "date", "gYearMonth", "gYear",
161                         "gMonthDay", "gDay", "gMonth",
162                         "hexBinary", "base64Binary",
163                         "anyURI", "QName", "NOTATION",
164                         "normalizedString", "token",
165                         "language", "IDREFS", "ENTITIES",
166                         "NMTOKEN", "NMTOKENS", "Name",
167                         "NCName", "ID", "IDREF", "ENTITY",
168                         "integer", "nonPositiveInteger",
169                         "negativeInteger", "long", "int",
170                         "short", "byte",
171                         "nonNegativeInteger", "unsignedLong",
172                         "unsignedInt", "unsignedShort",
173                         "unsignedByte", "positiveInteger"
174
175                     ]
176                 },
177                 "fieldPattern": {
178                     "description": "Regular expression that defines the field format",
179                     "type": "integer"
180                 },
181                 "fieldMaxLength": {
182                     "description": "The maximum length of the field",
183                     "type": "integer"
184                 },
185                 "fieldMinLength": {
186                     "description": "The minimum length of the field",
187                     "type": "integer"
188                 },
189                 "fieldMinimum": {
190                     "description": "The minimum numeric value of the field",
191                     "type": "integer"
192                 },
193                 "fieldMaximum": {
194                     "description": "The maximum numeric value of the field",
195                     "type": "integer"
196                 }
197             },
198             "additionalProperties": false
199         },
200         "dataformatversion": {
201             "type": "string",
202             "enum": ["1.0.0"]
203         }
204     }
205 }