adiwg-mdjson_schemas 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb8c3d9948dd510f6821421bdcb073ca4dc8790a
4
- data.tar.gz: fe3f53f9d7f77e918261b1eb28e3daf01d3bd1bc
3
+ metadata.gz: b1ce6d6761204f1c143e0a839dde422db8ca392b
4
+ data.tar.gz: eacd17e6943a5cc50ededa792fdab117ca252ee9
5
5
  SHA512:
6
- metadata.gz: 238ffb168303b6260e68c10c4497eb5c11949ee93e316571188f56cfa1673030895a1efcb67e6de589ffdd9ac2faa812cf67d2ee0d170c8918dfd4dd3dee1b34
7
- data.tar.gz: a63d1693f62dd7f93a728a19a215ff4ea8fa55043a79da0c0aac34d1a7fe1415773d3fe136758e1d26d908293f5c2a2dc4b76a1f0edbcf5948242c90cfb2516f
6
+ metadata.gz: 2fec3ee661ca83218ae6fd38c0a7ad5246e7c20c504dcf64d5c24a98313a84ab16e38cbfd262f0f52b355287568355abe43e30c6888bde75165f2a18bd2952d9
7
+ data.tar.gz: 8d1350417d0f836cb2935082d62e1f651c1c39b242a41df6622b236d4a4c3f4c65ec26257a741fb5d4b4bb63452229af4d6f697918a503d92f0d40085fedc1d9
@@ -0,0 +1,34 @@
1
+ # EditorConfig helps developers define and maintain consistent
2
+ # coding styles between different editors and IDEs
3
+ # editorconfig.org
4
+
5
+ root = true
6
+
7
+
8
+ [*]
9
+ end_of_line = lf
10
+ charset = utf-8
11
+ trim_trailing_whitespace = true
12
+ insert_final_newline = true
13
+ indent_style = space
14
+ indent_size = 2
15
+
16
+ [*.js]
17
+ indent_style = space
18
+ indent_size = 2
19
+
20
+ [*.hbs]
21
+ insert_final_newline = false
22
+ indent_style = space
23
+ indent_size = 2
24
+
25
+ [*.css]
26
+ indent_style = space
27
+ indent_size = 2
28
+
29
+ [*.html]
30
+ indent_style = space
31
+ indent_size = 2
32
+
33
+ [*.{diff,md}]
34
+ trim_trailing_whitespace = false
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .project
19
+ node_modules
@@ -0,0 +1,35 @@
1
+ {
2
+ "predef": [
3
+ "document",
4
+ "window",
5
+ "-Promise",
6
+ "describe",
7
+ "it"
8
+ ],
9
+ "browser": true,
10
+ "boss": true,
11
+ "curly": true,
12
+ "debug": false,
13
+ "devel": true,
14
+ "eqeqeq": true,
15
+ "evil": true,
16
+ "forin": false,
17
+ "immed": false,
18
+ "laxbreak": false,
19
+ "newcap": true,
20
+ "noarg": true,
21
+ "node": true,
22
+ "noempty": false,
23
+ "nonew": false,
24
+ "nomen": false,
25
+ "onevar": false,
26
+ "plusplus": false,
27
+ "regexp": false,
28
+ "undef": true,
29
+ "sub": true,
30
+ "strict": false,
31
+ "white": false,
32
+ "eqnull": true,
33
+ "esversion": 6,
34
+ "unused": true
35
+ }
data/LICENSE CHANGED
@@ -1,24 +1,165 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <http://unlicense.org>
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -2242,11 +2242,15 @@
2242
2242
  ],
2243
2243
  "funding": [{
2244
2244
  "allocation": [{
2245
+ "sourceAllocationId": "A123FW009",
2245
2246
  "amount": 9999.99,
2246
2247
  "currency": "USD",
2247
2248
  "sourceId": "CID005",
2248
2249
  "recipientId": "CID006",
2249
2250
  "matching": true,
2251
+ "onlineResource": [{
2252
+ "uri": "http://adiwg.org"
2253
+ }],
2250
2254
  "comment": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
2251
2255
  },
2252
2256
  {
@@ -21,7 +21,7 @@
21
21
  {
22
22
  "role": "role",
23
23
  "roleExtent": [{
24
- "temporalExtent": [{
24
+ "temporalExtent": [{
25
25
  "timePeriod": {
26
26
  "startDateTime": "2016-10-24T11:10:15.2-10:00"
27
27
  }
@@ -32,6 +32,64 @@
32
32
  }]
33
33
  }
34
34
  ],
35
+ "stepSource": [{
36
+ "description": "description",
37
+ "sourceCitation": {
38
+ "title": "title"
39
+ },
40
+ "metadataCitation": [{
41
+ "title": "title"
42
+ }, {
43
+ "title": "title"
44
+ }],
45
+ "spatialResolution": {
46
+ "measure": {
47
+ "type": "distance",
48
+ "value": 99.9,
49
+ "unitOfMeasure": "unitOfMeasure"
50
+ }
51
+ },
52
+ "referenceSystem": {
53
+ "referenceSystemType": "referenceSystemType",
54
+ "referenceSystemIdentifier": {
55
+ "identifier": "identifier"
56
+ }
57
+ },
58
+ "sourceProcessStep": [{
59
+ "description": "description"
60
+ }, {
61
+ "description": "description"
62
+ }]
63
+ }],
64
+ "stepProduct": [{
65
+ "description": "description",
66
+ "sourceCitation": {
67
+ "title": "title"
68
+ },
69
+ "metadataCitation": [{
70
+ "title": "title"
71
+ }, {
72
+ "title": "title"
73
+ }],
74
+ "spatialResolution": {
75
+ "measure": {
76
+ "type": "distance",
77
+ "value": 99.9,
78
+ "unitOfMeasure": "unitOfMeasure"
79
+ }
80
+ },
81
+ "referenceSystem": {
82
+ "referenceSystemType": "referenceSystemType",
83
+ "referenceSystemIdentifier": {
84
+ "identifier": "identifier"
85
+ }
86
+ },
87
+ "sourceProcessStep": [{
88
+ "description": "description"
89
+ }, {
90
+ "description": "description"
91
+ }]
92
+ }],
35
93
  "reference": [{
36
94
  "title": "title"
37
95
  },
@@ -8,7 +8,13 @@
8
8
  }, {
9
9
  "title": "title"
10
10
  }],
11
- "scaleDenominator": 9,
11
+ "spatialResolution": {
12
+ "measure": {
13
+ "type": "distance",
14
+ "value": 99.9,
15
+ "unitOfMeasure": "unitOfMeasure"
16
+ }
17
+ },
12
18
  "referenceSystem": {
13
19
  "referenceSystemType": "referenceSystemType",
14
20
  "referenceSystemIdentifier": {
@@ -0,0 +1,3 @@
1
+ const requireDirectory = require('require-directory');
2
+
3
+ module.exports = requireDirectory(module, './schema');
@@ -1,6 +1,6 @@
1
1
  module ADIWG
2
2
  module MdjsonSchemas
3
3
  # Current schema version number
4
- VERSION = "2.2.0"
4
+ VERSION = "2.3.0"
5
5
  end
6
6
  end
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "mdjson-schemas",
3
+ "version": "2.3.0",
4
+ "description": "JSON schemas, examples, and templates for ADIwg metadata standards",
5
+ "main": "index.js",
6
+ "directories": {
7
+ "doc": "doc",
8
+ "example": "examples",
9
+ "test": "test"
10
+ },
11
+ "scripts": {
12
+ "test": "mocha"
13
+ },
14
+ "files":[
15
+ "examples",
16
+ "schema"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/adiwg/mdJson-schemas.git"
21
+ },
22
+ "keywords": [
23
+ "json",
24
+ "metadata",
25
+ "mdJSON",
26
+ "json-schema",
27
+ "ADIwg",
28
+ "mdEditor",
29
+ "mdTranslator",
30
+ "mdCodes"
31
+ ],
32
+ "author": "jbradley@arcticlcc.org",
33
+ "license": "GPL-3.0",
34
+ "bugs": {
35
+ "url": "https://github.com/adiwg/mdJson-schemas/issues"
36
+ },
37
+ "homepage": "https://github.com/adiwg/mdJson-schemas#readme",
38
+ "devDependencies": {
39
+ "ajv": "^5.2.2",
40
+ "mocha": "^3.5.0"
41
+ },
42
+ "dependencies": {
43
+ "require-directory": "^2.1.1"
44
+ }
45
+ }
@@ -5,7 +5,6 @@
5
5
  "title": "",
6
6
  "description": "",
7
7
  "example":"../examples/attribute.json",
8
- "required": [],
9
8
  "dependencies": {
10
9
  "minValue": ["units"],
11
10
  "maxValue": ["units"],
@@ -3,7 +3,6 @@
3
3
  "$schema": "http://json-schema.org/draft-04/schema#",
4
4
  "type": "object",
5
5
  "description": "",
6
- "required": [],
7
6
  "minProperties": 1,
8
7
  "additionalProperties": true,
9
8
  "anyOf": [{
@@ -27,6 +26,10 @@
27
26
  "$ref": "./timePeriod.json#",
28
27
  "description": "The period for which the allocation is relevant.",
29
28
  "example": ""
29
+ },
30
+ "description": {
31
+ "type": "string",
32
+ "description": "Information describing the funding."
30
33
  }
31
34
  },
32
35
  "definitions": {
@@ -36,6 +39,10 @@
36
39
  "required": ["amount", "currency"],
37
40
  "additionalProperties": true,
38
41
  "properties": {
42
+ "sourceAllocationId": {
43
+ "type": "string",
44
+ "description": "Identifier used by the source contact to reference the allocation."
45
+ },
39
46
  "amount": {
40
47
  "type": "number",
41
48
  "description": "The amount of the allocation in the indicated currency."
@@ -60,6 +67,13 @@
60
67
  "comment": {
61
68
  "type": "string",
62
69
  "description": "Additional information relevant to the allocation."
70
+ },
71
+ "onlineResource": {
72
+ "type": "array",
73
+ "description": "On-line information related to the allocation.",
74
+ "items": {
75
+ "$ref": "onlineResource.json#"
76
+ }
63
77
  }
64
78
  }
65
79
  }
@@ -46,7 +46,6 @@
46
46
  }]
47
47
  },
48
48
  "centerPoint": {
49
- "type": "array",
50
49
  "description": "The earth location in the coordinate system defined by the Spatial Reference System and the grid coordinate of the cell halfway between opposite ends of the grid in the spatial dimensions.",
51
50
  "$ref": "#/definitions/point"
52
51
  },
@@ -7,7 +7,6 @@
7
7
  "translation": {
8
8
  "ISO 19115-2": ["MI_ImageDescription"]
9
9
  },
10
- "required": [],
11
10
  "additionalProperties": true,
12
11
  "properties": {
13
12
  "illuminationElevationAngle": {
@@ -120,6 +120,28 @@
120
120
  "$ref": "./responsibility.json#"
121
121
  }
122
122
  },
123
+ "stepSource": {
124
+ "type": "array",
125
+ "description": "Information about the source data used in the process step.",
126
+ "translation": {
127
+ "ISO 19115-2": ["DQ_DataQuality > LI_Lineage > LI_ProcessStep > LI_source"],
128
+ "FGDC CSDGM": ["dataqual > lineage > procstep > srcused"]
129
+ },
130
+ "items": {
131
+ "$ref": "#/definitions/source"
132
+ }
133
+ },
134
+ "stepProduct": {
135
+ "type": "array",
136
+ "description": "Information about an intermediate data set that (1) is significant in the opinion of the data producer, (2) is generated in the processing step, and (3) is used in later processing steps.",
137
+ "translation": {
138
+ "ISO 19115-2": ["DQ_DataQuality > LI_Lineage > LI_ProcessStep > LI_source"],
139
+ "FGDC CSDGM": ["dataqual > lineage > procstep > srcprod"]
140
+ },
141
+ "items": {
142
+ "$ref": "#/definitions/source"
143
+ }
144
+ },
123
145
  "reference": {
124
146
  "type": "array",
125
147
  "description": "Citation for process step documentation.",
@@ -143,6 +165,17 @@
143
165
  "ISO 19115-2": ["LI_Source"]
144
166
  },
145
167
  "additionalProperties": true,
168
+ "anyOf": [{
169
+ "title": "description is required",
170
+ "required": ["description"],
171
+ "description": "A description is required."
172
+ },
173
+ {
174
+ "title": "scope is required",
175
+ "required": ["scope"],
176
+ "description": "At least one scope is required."
177
+ }
178
+ ],
146
179
  "properties": {
147
180
  "description": {
148
181
  "type": "string",
@@ -5,7 +5,6 @@
5
5
  "title": "medium",
6
6
  "description": "Information about offline media on which the resource can be stored or distributed.",
7
7
  "example": "../examples/medium.json",
8
- "required": [],
9
8
  "additionalProperties": true,
10
9
  "properties": {
11
10
  "mediumSpecification": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "schema.json#",
3
3
  "$schema": "http://json-schema.org/draft-04/schema#",
4
- "version": "2.2.0",
4
+ "version": "2.3.0",
5
5
  "description": "schema for ADIwg mdJSON metadata",
6
6
  "example": "../examples/mdJson.json",
7
7
  "type": "object",
@@ -5,7 +5,6 @@
5
5
  "description": "",
6
6
  "translation": {},
7
7
  "type": "object",
8
- "required": [],
9
8
  "additionalProperties": true,
10
9
  "oneOf": [{
11
10
  "type": "object",
@@ -28,7 +28,6 @@
28
28
  "required": ["measure"],
29
29
  "properties": {
30
30
  "measure": {
31
- "type": "object",
32
31
  "title": "measure",
33
32
  "example": "../examples/spatialResolution.json",
34
33
  "description": "Scale of geographic extent expressed in ground distance parameters or angle.",
@@ -9,7 +9,6 @@
9
9
  "FGDC CSDGM": ["distinfo > stdorder > digform > digtopt"]
10
10
  },
11
11
  "example": "../examples/transferOption.json",
12
- "required": [],
13
12
  "additionalProperties": true,
14
13
  "properties": {
15
14
  "transferSize": {
@@ -7,4 +7,8 @@ class TestSchemaVersion < Minitest::Test
7
7
  schema = JSON.load File.new(File.join(File.dirname(__FILE__), '..', 'schema', 'schema.json'))
8
8
  assert_equal(ADIWG::MdjsonSchemas::VERSION, schema['version'], 'Gem version and schema versions are not equal')
9
9
  end
10
+ def test_node_version
11
+ package = JSON.load File.new(File.join(File.dirname(__FILE__), '..', 'package.json'))
12
+ assert_equal(ADIWG::MdjsonSchemas::VERSION, package['version'], 'Gem version and npm versions are not equal')
13
+ end
10
14
  end
@@ -0,0 +1,49 @@
1
+ const assert = require('assert');
2
+ const fs = require('fs');
3
+ const Schemas = require('../index.js');
4
+ const schemaFolder = '../schema/';
5
+
6
+ describe('Test schemas:', function() {
7
+
8
+ describe('Schemas', function() {
9
+ it('should return an object', function() {
10
+ assert.ok(Schemas === Object(Schemas));
11
+ });
12
+ });
13
+
14
+ describe('All schemas present', function() {
15
+ it('should return ok', function() {
16
+ fs.readdirSync(__dirname + '/' + schemaFolder).forEach(file => {
17
+ let schema = Schemas[file.split('.')[0]];
18
+
19
+ assert.ok(schema === Object(schema));
20
+ });
21
+ });
22
+ });
23
+
24
+ describe('ajv', function() {
25
+
26
+ const Ajv = require('ajv');
27
+ const data = require('../examples/mdJson.json');
28
+ const ajv = new Ajv({
29
+ extendRefs: 'fail'
30
+ });
31
+
32
+ it('should load all schemas', function() {
33
+
34
+ ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));
35
+
36
+ Object.keys(Schemas).forEach(function(key) {
37
+ let val = Schemas[key];
38
+
39
+ ajv.addSchema(val, key);
40
+ });
41
+ });
42
+
43
+ it('should validate example', function() {
44
+ ajv.validate('schema', data);
45
+ assert.equal(ajv.errors, null);
46
+ });
47
+ });
48
+
49
+ });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdjson_schemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Bradley, Stan Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-07 00:00:00.000000000 Z
11
+ date: 2017-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,8 +74,10 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".editorconfig"
77
78
  - ".github_changelog_generator"
78
79
  - ".gitignore"
80
+ - ".jshintrc"
79
81
  - ".travis.yml"
80
82
  - CHANGELOG.md
81
83
  - CREDITS
@@ -168,11 +170,13 @@ files:
168
170
  - examples/vectorRepresentation.json
169
171
  - examples/verticalExtent.json
170
172
  - examples/voucher.json
173
+ - index.js
171
174
  - lib/adiwg-mdjson_schemas.rb
172
175
  - lib/adiwg/mdjson_schemas.rb
173
176
  - lib/adiwg/mdjson_schemas/utils.rb
174
177
  - lib/adiwg/mdjson_schemas/validator.rb
175
178
  - lib/adiwg/mdjson_schemas/version.rb
179
+ - package.json
176
180
  - schema/additionalDocumentation.json
177
181
  - schema/associatedResource.json
178
182
  - schema/attribute.json
@@ -305,6 +309,7 @@ files:
305
309
  - test/tc_version.rb
306
310
  - test/tc_verticalExtent.rb
307
311
  - test/tc_voucher.rb
312
+ - test/test.js
308
313
  - test/tu_utils.rb
309
314
  homepage: https://github.com/adiwg/mdJson-schemas
310
315
  licenses:
@@ -326,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
331
  version: '0'
327
332
  requirements: []
328
333
  rubyforge_project:
329
- rubygems_version: 2.6.8
334
+ rubygems_version: 2.5.2
330
335
  signing_key:
331
336
  specification_version: 4
332
337
  summary: JSON schemas for the ADIwg metadata standard
@@ -408,4 +413,5 @@ test_files:
408
413
  - test/tc_version.rb
409
414
  - test/tc_verticalExtent.rb
410
415
  - test/tc_voucher.rb
416
+ - test/test.js
411
417
  - test/tu_utils.rb