adiwg-json_schemas 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -168,6 +168,9 @@
168
168
  }
169
169
  }
170
170
  }
171
+ },
172
+ "dataDictionary": {
173
+ "$ref": "dataDictionary.json#"
171
174
  }
172
175
  }
173
176
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": {
3
- "name": "adiwgJson",
3
+ "name": "mdJson",
4
4
  "version": "0.9.0"
5
5
  },
6
6
  "contact": [
@@ -0,0 +1,189 @@
1
+ {
2
+ "$schema" : "http://json-schema.org/draft-04/schema#",
3
+ "id" : "http://json-schema.org/draft-04/schema#",
4
+ "type" : "object",
5
+
6
+ "properties" : {
7
+ "type" : {
8
+ "type" : [
9
+ {
10
+ "id" : "#simple-type",
11
+ "type" : "string",
12
+ "enum" : ["object", "array", "string", "number", "boolean", "null", "any"]
13
+ },
14
+ "array"
15
+ ],
16
+ "items" : {
17
+ "type" : [
18
+ {"$ref" : "#simple-type"},
19
+ {"$ref" : "#"}
20
+ ]
21
+ },
22
+ "uniqueItems" : true,
23
+ "default" : "any"
24
+ },
25
+
26
+ "disallow" : {
27
+ "type" : ["string", "array"],
28
+ "items" : {
29
+ "type" : ["string", {"$ref" : "#"}]
30
+ },
31
+ "uniqueItems" : true
32
+ },
33
+
34
+ "extends" : {
35
+ "type" : [{"$ref" : "#"}, "array"],
36
+ "items" : {"$ref" : "#"},
37
+ "default" : {}
38
+ },
39
+
40
+ "enum" : {
41
+ "type" : "array",
42
+ "minItems" : 1,
43
+ "uniqueItems" : true
44
+ },
45
+
46
+ "minimum" : {
47
+ "type" : "number"
48
+ },
49
+
50
+ "maximum" : {
51
+ "type" : "number"
52
+ },
53
+
54
+ "exclusiveMinimum" : {
55
+ "type" : "boolean",
56
+ "default" : false
57
+ },
58
+
59
+ "exclusiveMaximum" : {
60
+ "type" : "boolean",
61
+ "default" : false
62
+ },
63
+
64
+ "divisibleBy" : {
65
+ "type" : "number",
66
+ "minimum" : 0,
67
+ "exclusiveMinimum" : true,
68
+ "default" : 1
69
+ },
70
+
71
+ "minLength" : {
72
+ "type" : "integer",
73
+ "minimum" : 0,
74
+ "default" : 0
75
+ },
76
+
77
+ "maxLength" : {
78
+ "type" : "integer"
79
+ },
80
+
81
+ "pattern" : {
82
+ "type" : "string"
83
+ },
84
+
85
+ "items" : {
86
+ "type" : [{"$ref" : "#"}, "array"],
87
+ "items" : {"$ref" : "#"},
88
+ "default" : {}
89
+ },
90
+
91
+ "additionalItems" : {
92
+ "type" : [{"$ref" : "#"}, "boolean"],
93
+ "default" : {}
94
+ },
95
+
96
+ "minItems" : {
97
+ "type" : "integer",
98
+ "minimum" : 0,
99
+ "default" : 0
100
+ },
101
+
102
+ "maxItems" : {
103
+ "type" : "integer",
104
+ "minimum" : 0
105
+ },
106
+
107
+ "uniqueItems" : {
108
+ "type" : "boolean",
109
+ "default" : false
110
+ },
111
+
112
+ "properties" : {
113
+ "type" : "object",
114
+ "additionalProperties" : {"$ref" : "#"},
115
+ "default" : {}
116
+ },
117
+
118
+ "patternProperties" : {
119
+ "type" : "object",
120
+ "additionalProperties" : {"$ref" : "#"},
121
+ "default" : {}
122
+ },
123
+
124
+ "additionalProperties" : {
125
+ "type" : [{"$ref" : "#"}, "boolean"],
126
+ "default" : {}
127
+ },
128
+
129
+ "minProperties" : {
130
+ "type" : "integer",
131
+ "minimum" : 0,
132
+ "default" : 0
133
+ },
134
+
135
+ "maxProperties" : {
136
+ "type" : "integer",
137
+ "minimum" : 0
138
+ },
139
+
140
+ "required" : {
141
+ "type" : "array",
142
+ "items" : {
143
+ "type" : "string"
144
+ }
145
+ },
146
+
147
+ "dependencies" : {
148
+ "type" : "object",
149
+ "additionalProperties" : {
150
+ "type" : ["string", "array", {"$ref" : "#"}],
151
+ "items" : {
152
+ "type" : "string"
153
+ }
154
+ },
155
+ "default" : {}
156
+ },
157
+
158
+ "id" : {
159
+ "type" : "string"
160
+ },
161
+
162
+ "$ref" : {
163
+ "type" : "string"
164
+ },
165
+
166
+ "$schema" : {
167
+ "type" : "string"
168
+ },
169
+
170
+ "title" : {
171
+ "type" : "string"
172
+ },
173
+
174
+ "description" : {
175
+ "type" : "string"
176
+ },
177
+
178
+ "default" : {
179
+ "type" : "any"
180
+ }
181
+ },
182
+
183
+ "dependencies" : {
184
+ "exclusiveMinimum" : "minimum",
185
+ "exclusiveMaximum" : "maximum"
186
+ },
187
+
188
+ "default" : {}
189
+ }
data/test/tc_schemas.rb CHANGED
@@ -26,7 +26,7 @@ class TestExamples < Minitest::Test
26
26
  errors = Array.new
27
27
 
28
28
  schemas.each do |schema|
29
- error = JSON::Validator.fully_validate('http://json-schema.org/draft-04/schema', schema)
29
+ error = JSON::Validator.fully_validate(File.join(File.dirname(__FILE__), 'draft-04.json'), schema)
30
30
  errors += error
31
31
  end
32
32
 
@@ -68,6 +68,11 @@ class TestExamples < Minitest::Test
68
68
  assert(errors.empty?, errors.join("/n"))
69
69
  end
70
70
 
71
+ def test_dictionary
72
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/dataDictionary.json', @@ex + 'dataDictionary.json', :list => true)
73
+ assert(errors.empty?, errors.join("/n"))
74
+ end
75
+
71
76
  def test_taxonomy
72
77
  errors = JSON::Validator.fully_validate(@@dir + 'schema/taxonomy.json', @@ex + 'taxonomy.json', :list => true)
73
78
  assert(errors.empty?, errors.join("/n"))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-json_schemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
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: 2014-11-25 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '2.2'
47
+ version: 2.4.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '2.2'
54
+ version: 2.4.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -85,6 +85,7 @@ files:
85
85
  - examples/citation.json
86
86
  - examples/contact.json
87
87
  - examples/contactRef.json
88
+ - examples/dataDictionary.json
88
89
  - examples/dataQuality.json
89
90
  - examples/date.json
90
91
  - examples/distributor.json
@@ -117,6 +118,7 @@ files:
117
118
  - schema/schema.json
118
119
  - schema/schema/citation.json
119
120
  - schema/schema/contact.json
121
+ - schema/schema/dataDictionary.json
120
122
  - schema/schema/dataQuality.json
121
123
  - schema/schema/distributor.json
122
124
  - schema/schema/extent.json
@@ -135,6 +137,7 @@ files:
135
137
  - schema/schema/taxonomy.json
136
138
  - schema/schema/usage.json
137
139
  - templates/adiwg_metadata_template.json
140
+ - test/draft-04.json
138
141
  - test/tc_schemas.rb
139
142
  - test/tc_utils.rb
140
143
  homepage: https://github.com/adiwg/mdJson-schemas
@@ -162,5 +165,6 @@ signing_key:
162
165
  specification_version: 4
163
166
  summary: JSON schemas for the ADIwg metadata standard
164
167
  test_files:
168
+ - test/draft-04.json
165
169
  - test/tc_schemas.rb
166
170
  - test/tc_utils.rb