adiwg-mdjson_schemas 2.0.0.pre.alpha → 2.0.0.pre.alpha.1

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: e5125c25a518b68af4142a3898e57c54e2f6a2b2
4
- data.tar.gz: 63fec0692270d4f3212206e5653c3640be89ae59
3
+ metadata.gz: 932b652a0686b504c4268ae584df424159cb9a07
4
+ data.tar.gz: 56bf0ed2ae13559a874bb30570a0f252641e82f2
5
5
  SHA512:
6
- metadata.gz: dc2fb2be42f7cabeaeb7636f33d234743558251b78a90846b530574d5c0c0a9f1a3707394b41eab6e4129e4cb672c8c483e28c83be85934724fbeee086b46c5d
7
- data.tar.gz: a5cfd9e9731a602e408fc524b8ad5a073f2d2edbfc03e2abebf36ce69f4175792ca6819e75e32f75afac52284a9eef90a2a963514b1fd6c97f0cf8b0723b9be8
6
+ metadata.gz: 99066ba89e99cd8ad9645301b41dadd4ca71bd6ecb472887b830fda9d06f6607b7d9615c563c22f9327b89be7b9ebcb317ad9563dca41b2440f79a355660c098
7
+ data.tar.gz: a1c19d62d0b8cedfdf329955db450a8f0d3e55bc82711cf07cb8f57465f1945819534f41e784a7f4a81f5222fd05abf2bc16ecbd80bb46ab7a22ee1348ba69d0
data/Rakefile CHANGED
@@ -9,4 +9,13 @@ Rake::TestTask.new do |t|
9
9
  end
10
10
 
11
11
  desc "Run tests"
12
- task :default => :test
12
+ task :default => :test
13
+
14
+ Rake::TestTask.new do |t|
15
+ t.libs << 'test'
16
+ t.test_files = FileList['test/tu*.rb']
17
+ t.verbose = true
18
+ end
19
+
20
+ desc "Run utility tests"
21
+ task :default => :test
@@ -22,18 +22,20 @@
22
22
  },
23
23
  "responsibleParty": [{
24
24
  "role": "role0",
25
- "roleExtent": {
26
- "description": "description0"
27
- },
25
+ "timePeriod": [{
26
+ "startDateTime": "2016-10-14T11:10:15.2-10:00",
27
+ "endDateTime": "2016-12-31"
28
+ }],
28
29
  "party": [{
29
30
  "contactId": "individualId0"
30
31
  }]
31
32
  },
32
33
  {
33
34
  "role": "role1",
34
- "roleExtent": {
35
- "description": "description1"
36
- },
35
+ "timePeriod": [{
36
+ "startDateTime": "2016-10-14T11:10:15.2-10:00",
37
+ "endDateTime": "2016-12-31"
38
+ }],
37
39
  "party": [{
38
40
  "contactId": "individualId0"
39
41
  }]
@@ -1,11 +1,21 @@
1
1
  [{
2
- "resourceType": "resourceType",
3
2
  "citation": {
4
3
  "title": "title"
5
4
  },
6
- "description": "description",
7
- "language": "language",
8
5
  "subject": "subject",
6
+ "locale": [
7
+ {
8
+ "language": "language1",
9
+ "country": "country1",
10
+ "characterSet": "characterSet1"
11
+ },
12
+ {
13
+ "language": "rar",
14
+ "country": "COK",
15
+ "characterSet": "UTF-8"
16
+ }
17
+ ],
18
+ "recommendedUse": [""],
9
19
  "responsibleParty": {
10
20
  "role": "role",
11
21
  "party": [{
@@ -70,7 +70,6 @@
70
70
  }
71
71
  },
72
72
  "dataDictionary": [{
73
- "resourceType": "resourceType",
74
73
  "subject": "subject",
75
74
  "responsibleParty": {
76
75
  "role": "role",
@@ -80,10 +79,8 @@
80
79
  },
81
80
  "citation": {
82
81
  "title": "title"
83
- },
84
- "description": "description"
82
+ }
85
83
  }, {
86
- "resourceType": "resourceType",
87
84
  "subject": "subject",
88
85
  "responsibleParty": {
89
86
  "role": "role",
@@ -93,7 +90,6 @@
93
90
  },
94
91
  "citation": {
95
92
  "title": "title"
96
- },
97
- "description": "description"
93
+ }
98
94
  }]
99
95
  }
@@ -7,18 +7,20 @@
7
7
  },
8
8
  "processor": [{
9
9
  "role": "role",
10
- "roleExtent": {
11
- "description": "description"
12
- },
10
+ "timePeriod": [{
11
+ "startDateTime": "2016-10-14T11:10:15.2-10:00",
12
+ "endDateTime": "2016-12-31"
13
+ }],
13
14
  "party": [{
14
15
  "contactId": "individualId0"
15
16
  }]
16
17
  },
17
18
  {
18
19
  "role": "role",
19
- "roleExtent": {
20
- "description": "description"
21
- },
20
+ "timePeriod": [{
21
+ "startDateTime": "2016-10-14T11:10:15.2-10:00",
22
+ "endDateTime": "2016-12-31"
23
+ }],
22
24
  "party": [{
23
25
  "contactId": "individualId0"
24
26
  }]
@@ -1,9 +1,10 @@
1
1
  [{
2
2
  "addressee": [{
3
3
  "role": "role",
4
- "roleExtent": {
5
- "description": "description"
6
- },
4
+ "timePeriod": [{
5
+ "startDateTime": "2016-10-14T11:10:15.2-10:00",
6
+ "endDateTime": "2016-12-31"
7
+ }],
7
8
  "party": [{
8
9
  "contactId": "individualId0"
9
10
  }]
@@ -18,9 +19,10 @@
18
19
  }, {
19
20
  "addressee": [{
20
21
  "role": "role",
21
- "roleExtent": {
22
- "description": "description"
23
- },
22
+ "timePeriod": [{
23
+ "startDateTime": "2016-10-14T11:10:15.2-10:00",
24
+ "endDateTime": "2016-12-31"
25
+ }],
24
26
  "party": [{
25
27
  "contactId": "individualId0"
26
28
  }]
@@ -114,7 +114,7 @@
114
114
  "citation": {
115
115
  "title": "title"
116
116
  },
117
- "modification": "modification"
117
+ "modifications": "modification"
118
118
  }],
119
119
  "identificationReference": [{
120
120
  "identifier": "identifier0",
@@ -3,7 +3,7 @@
3
3
  "citation": {
4
4
  "title": "title"
5
5
  },
6
- "modification": "modification"
6
+ "modifications": "modification"
7
7
  },
8
8
  {
9
9
  "citation": {
@@ -19,9 +19,9 @@
19
19
  }
20
20
  }
21
21
  ],
22
- "transferFrequency": {
22
+ "transferFrequency": [{
23
23
  "months": 9
24
- },
24
+ }],
25
25
  "distributionFormat": [{
26
26
  "formatSpecification": {
27
27
  "title": "title0"
@@ -39,9 +39,10 @@
39
39
  },
40
40
  {
41
41
  "role": "role1",
42
- "roleExtent": {
43
- "description": "description1"
44
- },
42
+ "timePeriod": [{
43
+ "startDateTime": "2016-10-14T11:10:15.2-10:00",
44
+ "endDateTime": "2016-12-31"
45
+ }],
45
46
  "party": [{
46
47
  "contactId": "individualId1"
47
48
  }]
@@ -36,11 +36,21 @@ module ADIWG
36
36
 
37
37
  # Pre-load all of the json-schemas for mdJSON validation
38
38
  #
39
+ # @param [Boolean] strict If true, will disallow additional properties
39
40
  # @return [nil]
40
- def self.load_schemas
41
+ def self.load_schemas(strict=false)
41
42
  Dir.glob(schema_dir + '*.json') do |schema|
43
+ loaded = Utils.load_json(schema)
42
44
  name = File.basename(schema)
43
- jschema = JSON::Schema.new(Utils.load_json(schema), Addressable::URI.parse(name))
45
+
46
+ if strict
47
+ loaded['additionalProperties'] = false
48
+ loaded['definitions'].each do |_key, val|
49
+ val['additionalProperties'] = false
50
+ end unless loaded['definitions'].nil?
51
+ end
52
+
53
+ jschema = JSON::Schema.new(loaded, Addressable::URI.parse(name))
44
54
 
45
55
  JSON::Validator.add_schema(jschema)
46
56
  end
@@ -1,6 +1,6 @@
1
1
  module ADIWG
2
2
  module MdjsonSchemas
3
3
  # Current schema version number
4
- VERSION = "2.0.0-alpha"
4
+ VERSION = "2.0.0-alpha.1"
5
5
  end
6
6
  end
@@ -1,147 +1,138 @@
1
1
  {
2
2
  "id": "citation.json#",
3
3
  "$schema": "http://json-schema.org/draft-04/schema#",
4
- "description": "schema for citation",
4
+ "type": "object",
5
+ "title": "citation",
6
+ "description": "A citation object.",
7
+ "required": ["title"],
8
+ "example": "",
5
9
  "translation": {
10
+ "FGDC CSDGM": ["idinfo > citation > citeinfo"],
6
11
  "ISO 19115-2": ["CI_Citation"]
7
12
  },
8
- "type": "object",
9
- "required": ["title"],
10
- "allOf": [{
11
- "$ref": "#/definitions/citationFull"
12
- }],
13
- "definitions": {
14
- "citationFull": {
15
- "type": "object",
16
- "title": "full citation",
17
- "description": "A full citation object, all attributes are supported.",
18
- "example": "",
13
+ "properties": {
14
+ "title": {
15
+ "type": "string",
16
+ "description": "Name by which the cited resource is known.",
17
+ "translation": {
18
+ "ISO 19115-2": ["CI_Citation > title", "FC_FeatureCatalogue > name"],
19
+ "FGDC CSDGM": ["idinfo > citation > citeinfo > title"]
20
+ }
21
+ },
22
+ "alternateTitle": {
23
+ "type": "array",
24
+ "description": "Alias by which the cited resource is known.",
19
25
  "translation": {
20
- "FGDC CSDGM": ["idinfo > citation > citeinfo"]
26
+ "ISO 19115-2": ["CI_Citation > alternateTitle"]
21
27
  },
22
- "properties": {
23
- "title": {
24
- "type": "string",
25
- "description": "Name by which the cited resource is known.",
26
- "translation": {
27
- "ISO 19115-2": ["CI_Citation > title", "FC_FeatureCatalogue > name"],
28
- "FGDC CSDGM": ["idinfo > citation > citeinfo > title"]
29
- }
30
- },
31
- "alternateTitle": {
32
- "type": "array",
33
- "description": "Alias by which the cited resource is known.",
34
- "translation": {
35
- "ISO 19115-2": ["CI_Citation > alternateTitle"]
36
- },
37
- "items": {
38
- "type": "string"
39
- }
40
- },
41
- "date": {
42
- "type": "array",
43
- "description": "Date referenced to the cited resource.",
44
- "translation": {
45
- "ISO 19115-2": ["CI_Citation > date > CI_Date"]
28
+ "items": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ "date": {
33
+ "type": "array",
34
+ "description": "Date referenced to the cited resource.",
35
+ "translation": {
36
+ "ISO 19115-2": ["CI_Citation > date > CI_Date"]
37
+ },
38
+ "minItems": 1,
39
+ "items": {
40
+ "type": "object",
41
+ "example": "",
42
+ "required": ["date", "dateType"],
43
+ "properties": {
44
+ "date": {
45
+ "translation": {
46
+ "ISO 19115-2": ["CI_Date > date", "FC_FeatureCatalogue > versionDate"],
47
+ "FGDC CSDGM": ["idinfo > citation > citeinfo > pubdate"]
48
+ },
49
+ "$ref": "common.json#/definitions/date"
46
50
  },
47
- "minItems": 1,
48
- "items": {
49
- "type": "object",
50
- "example": "",
51
- "required": ["date", "dateType"],
52
- "properties": {
53
- "date": {
54
- "translation": {
55
- "ISO 19115-2": ["CI_Date > date", "FC_FeatureCatalogue > versionDate"],
56
- "FGDC CSDGM": ["idinfo > citation > citeinfo > pubdate"]
57
- },
58
- "$ref": "common.json#/definitions/date"
59
- },
60
- "dateType": {
61
- "type": "string",
62
- "description": "The type of date in the context of the citation.",
63
- "translation": {
64
- "ISO 19115-2": ["CI_Date > dateType [CI_DateTypeCode]"]
65
- }
66
- }
51
+ "dateType": {
52
+ "type": "string",
53
+ "description": "The type of date in the context of the citation.",
54
+ "translation": {
55
+ "ISO 19115-2": ["CI_Date > dateType [CI_DateTypeCode]"]
67
56
  }
68
57
  }
69
- },
70
- "edition": {
71
- "type": "string",
72
- "description": "Version identifier for the resource.",
73
- "translation": {
74
- "ISO 19115-2": ["CI_Citation > edition"],
75
- "FGDC CSDGM": ["idinfo > citation > edition"]
76
- }
77
- },
78
- "responsibleParty": {
79
- "type": "array",
80
- "description": "Identification of, and means of communication with, person(s) and organization(s) associated with the cited resource.",
81
- "translation": {
82
- "ISO 19115-2": ["CI_Citation > citedResponsibleParty > CI_ResponsibleParty", "FC_FeatureCatalogue > producer > CI_ResponisbleParty"],
83
- "FGDC CSDGM": ["idinfo > ptcontac > cntinfo"]
84
- },
85
- "minItems": 1,
86
- "items": {
87
- "$ref": "responsibility.json#"
88
- }
89
- },
90
- "presentationForm": {
91
- "type": "array",
92
- "description": "The form that the resource is presented, such as: digital map, digital document, etc.",
93
- "translation": {
94
- "ISO 19115-2": ["CI_Citation > presentationForm [CI_PresentationFormCode]"],
95
- "FGDC CSDGM": ["idinfo > citation > geoform"]
96
- },
97
- "items": {
98
- "type": "string"
99
- }
100
- },
101
- "identifier": {
102
- "type": "array",
103
- "description": "Identifier for the resource in the context of the citation.",
104
- "translation": {
105
- "ISO 19115-2": ["CI_Citation > identifier"]
106
- },
107
- "items": {
108
- "$ref": "./identifier.json#"
109
- }
110
- },
111
- "series": {
112
- "$ref": "#/definitions/series"
113
-
114
- },
115
- "otherCitationDetails": {
116
- "type": "array",
117
- "description": "Other information required to complete the citation that is not recorded elsewhere.",
118
- "example": "",
119
- "translation": {},
120
- "items": {
121
- "type": "string"
122
- }
123
- },
124
- "onlineResource": {
125
- "type": "array",
126
- "description": "On-line information related to the citation.",
127
- "translation": {
128
- "ISO 19115-2": ["CI_Citation > citedResponsibleParty > CI_ResponsibleParty > contact > CI_Contact > onlineResource > CI_OnlineResource"]
129
- },
130
- "items": {
131
- "$ref": "onlineResource.json#"
132
- }
133
- },
134
- "graphic": {
135
- "type": "array",
136
- "description": "Online graphic associated with the citation",
137
- "example": "",
138
- "translation": {},
139
- "items": {
140
- "$ref": "./graphic.json#"
141
- }
142
58
  }
143
59
  }
144
60
  },
61
+ "edition": {
62
+ "type": "string",
63
+ "description": "Version identifier for the resource.",
64
+ "translation": {
65
+ "ISO 19115-2": ["CI_Citation > edition", "FC_FeatureCatalogue > versionNumber"],
66
+ "FGDC CSDGM": ["idinfo > citation > edition"]
67
+ }
68
+ },
69
+ "responsibleParty": {
70
+ "type": "array",
71
+ "description": "Identification of, and means of communication with, person(s) and organization(s) associated with the cited resource.",
72
+ "translation": {
73
+ "ISO 19115-2": ["CI_Citation > citedResponsibleParty > CI_ResponsibleParty", "FC_FeatureCatalogue > producer > CI_ResponisbleParty"],
74
+ "FGDC CSDGM": ["idinfo > ptcontac > cntinfo"]
75
+ },
76
+ "minItems": 1,
77
+ "items": {
78
+ "$ref": "responsibility.json#"
79
+ }
80
+ },
81
+ "presentationForm": {
82
+ "type": "array",
83
+ "description": "The form that the resource is presented, such as: digital map, digital document, etc.",
84
+ "translation": {
85
+ "ISO 19115-2": ["CI_Citation > presentationForm [CI_PresentationFormCode]"],
86
+ "FGDC CSDGM": ["idinfo > citation > geoform"]
87
+ },
88
+ "items": {
89
+ "type": "string"
90
+ }
91
+ },
92
+ "identifier": {
93
+ "type": "array",
94
+ "description": "Identifier for the resource in the context of the citation.",
95
+ "translation": {
96
+ "ISO 19115-2": ["CI_Citation > identifier"]
97
+ },
98
+ "items": {
99
+ "$ref": "./identifier.json#"
100
+ }
101
+ },
102
+ "series": {
103
+ "$ref": "#/definitions/series"
104
+
105
+ },
106
+ "otherCitationDetails": {
107
+ "type": "array",
108
+ "description": "Other information required to complete the citation that is not recorded elsewhere.",
109
+ "example": "",
110
+ "translation": {},
111
+ "items": {
112
+ "type": "string"
113
+ }
114
+ },
115
+ "onlineResource": {
116
+ "type": "array",
117
+ "description": "On-line information related to the citation.",
118
+ "translation": {
119
+ "ISO 19115-2": ["CI_Citation > citedResponsibleParty > CI_ResponsibleParty > contact > CI_Contact > onlineResource > CI_OnlineResource"]
120
+ },
121
+ "items": {
122
+ "$ref": "onlineResource.json#"
123
+ }
124
+ },
125
+ "graphic": {
126
+ "type": "array",
127
+ "description": "Online graphic associated with the citation",
128
+ "example": "",
129
+ "translation": {},
130
+ "items": {
131
+ "$ref": "./graphic.json#"
132
+ }
133
+ }
134
+ },
135
+ "definitions": {
145
136
  "series": {
146
137
  "type": "object",
147
138
  "description": "Information about the series, or aggregate resource, to which a resource belongs.",
@@ -160,25 +151,6 @@
160
151
  "type": "string"
161
152
  }
162
153
  }
163
- },
164
- "dictionary": {
165
- "type": "object",
166
- "example": "",
167
- "required": ["title", "date"],
168
- "title": "dictionary citation",
169
- "description": "A citation object for data dictionaries.",
170
- "properties": {
171
- "edition": {
172
- "type": "string",
173
- "description": "Version identifier for the dictionary.",
174
- "translation": {
175
- "ISO 19115-2": ["FC_FeatureCatalogue > versionNumber"]
176
- }
177
- }
178
- },
179
- "allOf": [{
180
- "$ref": "#/definitions/citationFull"
181
- }]
182
154
  }
183
155
  }
184
156
  }
@@ -20,27 +20,34 @@
20
20
  }
21
21
  },
22
22
  "recommendedUse": {
23
- "type": "string",
23
+ "type": "array",
24
24
  "description": "Description of kind(s) of use to which this dictionary may be put.",
25
25
  "translation": {
26
26
  "ISO 19115-2": ["FC_FeatureCatalogue > fieldOfApplication > CharacterString"]
27
+ },
28
+ "items": {
29
+ "type": "string"
27
30
  }
28
31
  },
29
32
  "locale": {
30
- "$ref": "./locale.json",
33
+ "type": "array",
31
34
  "description": "Defines the language and country of origin in which the data dictionary is written. E.g. 'eng; USA', 'eng; UK', 'esp; MEX'.",
32
35
  "translation": {
33
36
  "ISO 19115-2": ["FC_FeatureCatalogue > language"]
37
+ },
38
+ "items": {
39
+ "$ref": "./locale.json"
34
40
  }
41
+
35
42
  },
36
43
  "responsibleParty": {
37
44
  "$ref": "./responsibility.json#",
38
45
  "description": "Name, address, country, and telecommunications address of person or organization having primary responsibility for the intellectual content of this dictionary."
39
46
  },
40
47
  "dictionaryFormat": {
41
- "type" : "string",
42
- "description" : "Formal functional language used in the dictionary.",
43
- "translation": {}
48
+ "type": "string",
49
+ "description": "Formal functional language used in the dictionary.",
50
+ "translation": {}
44
51
  },
45
52
  "dictionaryIncludedWithResource": {
46
53
  "type": "boolean",
@@ -41,7 +41,7 @@
41
41
  "translation": {
42
42
  "ISO 19115-2": ["MD_Identifier > authority > CI_Citation"]
43
43
  },
44
- "$ref": "./citation.json#/definitions/citationFull"
44
+ "$ref": "./citation.json#"
45
45
  }
46
46
  }
47
47
  }
@@ -33,7 +33,7 @@
33
33
  "ISO 19115-2": ["MD_Keywords > thesaurusName > CI_Citation"],
34
34
  "FGDC CSDGM": ["idinfo>keywords>theme>themekt", "idinfo>keywords>place>placekt", "idinfo>keywords>temporal>tempkt", "idinfo>keywords>stratum>stratkt"]
35
35
  },
36
- "$ref": "citation.json#/definitions/citationFull"
36
+ "$ref": "citation.json#"
37
37
  }
38
38
  },
39
39
  "definitions": {
@@ -19,7 +19,7 @@
19
19
  "translation": {
20
20
  "ISO 19115-2": ["MI_Metadata > parentIdentifier"]
21
21
  },
22
- "$ref": "citation.json#/definitions/citationFull"
22
+ "$ref": "citation.json#"
23
23
  },
24
24
  "defaultMetadataLocale": {
25
25
  "description": "Main localised language and characterset used within the metadata record.",
@@ -142,6 +142,12 @@
142
142
  "items": {
143
143
  "type": "string"
144
144
  }
145
+ },
146
+ "subClassification": {
147
+ "type": "array",
148
+ "items": {
149
+ "$ref": "#/definitions/taxonomicClassification"
150
+ }
145
151
  }
146
152
  }
147
153
  },
@@ -44,17 +44,26 @@
44
44
  "additionalProperties": true,
45
45
  "items": {
46
46
  "$ref": "./medium.json#"
47
- },
48
- "distributionFormat": {
49
- "type": "array",
50
- "description": "Provides information about the format used by the distributor.",
51
- "translation": {
52
- "ISO 19115-2": ["MD_Distribution > distributor > MD_Distributor > distributorFormat > MD_Format"],
53
- "FGDC CSDGM": ["distinfo > stdorder > digform"]
54
- },
55
- "items": {
56
- "$ref": "#/definitions/format"
47
+ }
48
+ },
49
+ "transferFrequency": {
50
+ "type" : "array",
51
+ "description" : "The rate of occurrence of distribution.",
52
+ "example": "",
53
+ "translation": {},
54
+ "items" : {
55
+ "$ref": "./timePeriod.json#/definitions/duration"
57
56
  }
57
+ },
58
+ "distributionFormat": {
59
+ "type": "array",
60
+ "description": "Provides information about the format used by the distributor.",
61
+ "translation": {
62
+ "ISO 19115-2": ["MD_Distribution > distributor > MD_Distributor > distributorFormat > MD_Format"],
63
+ "FGDC CSDGM": ["distinfo > stdorder > digform"]
64
+ },
65
+ "items": {
66
+ "$ref": "./format.json#"
58
67
  }
59
68
  }
60
69
  }
@@ -17,16 +17,17 @@ class TestHelper < Minitest::Test
17
17
 
18
18
  @@strict = false
19
19
 
20
- def self.load_json(filename)
21
- JSON.load File.new(filename)
22
- end
23
-
24
- schemas = `git ls-files #{@@dir}/schema`.split($/)
25
-
26
- schemas.each do |schema|
27
- name = File.basename(schema)
28
- jschema = JSON::Schema.new(TestHelper.load_json(schema), Addressable::URI.parse(name))
29
-
30
- JSON::Validator.add_schema(jschema)
31
- end
20
+ # def self.load_json(filename)
21
+ # JSON.load File.new(filename)
22
+ # end
23
+ #
24
+ # schemas = `git ls-files #{@@dir}/schema`.split($/)
25
+ #
26
+ # schemas.each do |schema|
27
+ # name = File.basename(schema)
28
+ # jschema = JSON::Schema.new(TestHelper.load_json(schema), Addressable::URI.parse(name))
29
+ #
30
+ # JSON::Validator.add_schema(jschema)
31
+ # end
32
+ ADIWG::MdjsonSchemas::Utils.load_schemas(false)
32
33
  end
@@ -2,7 +2,7 @@ require 'helper.rb'
2
2
 
3
3
  class TestRootSchema < TestHelper
4
4
  def test_root_schema
5
- errors = JSON::Validator.fully_validate(@@schema, @@example + 'mdJson.json', strict: @@strict)
5
+ errors = JSON::Validator.fully_validate('schema.json', @@example + 'mdJson.json', strict: @@strict)
6
6
  assert(errors.empty?, errors.join("\n"))
7
7
  end
8
8
  end
@@ -20,4 +20,13 @@ class TestUtils < Minitest::Test
20
20
  errors = File.exist?(ADIWG::MdjsonSchemas::Utils.schema_dir)
21
21
  assert_equal(true, errors, 'Schema directory does not exist.')
22
22
  end
23
+
24
+ def test_load_schemas
25
+ assert_nil(ADIWG::MdjsonSchemas::Utils.load_schemas, 'Failed to load schemas.')
26
+
27
+ JSON::Validator.clear_cache
28
+
29
+ assert_nil(ADIWG::MdjsonSchemas::Utils.load_schemas(true), 'Failed to load schemas.')
30
+ assert_nil(JSON::Validator::schemas.detect { |schema| schema[1].schema['additionalProperties'] }, 'Failed to set additionalProperties.')
31
+ end
23
32
  end
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.0.0.pre.alpha
4
+ version: 2.0.0.pre.alpha.1
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-02-03 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -291,10 +291,10 @@ files:
291
291
  - test/tc_transferOption.rb
292
292
  - test/tc_uri.rb
293
293
  - test/tc_usage.rb
294
- - test/tc_utils.rb
295
294
  - test/tc_vectorRepresentation.rb
296
295
  - test/tc_verticalExtent.rb
297
296
  - test/tc_voucher.rb
297
+ - test/tu_utils.rb
298
298
  homepage: https://github.com/adiwg/mdJson-schemas
299
299
  licenses:
300
300
  - UNLICENSE
@@ -386,7 +386,7 @@ test_files:
386
386
  - test/tc_transferOption.rb
387
387
  - test/tc_uri.rb
388
388
  - test/tc_usage.rb
389
- - test/tc_utils.rb
390
389
  - test/tc_vectorRepresentation.rb
391
390
  - test/tc_verticalExtent.rb
392
391
  - test/tc_voucher.rb
392
+ - test/tu_utils.rb