json-schema 2.6.0 → 2.6.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: a58ce34e91bb60549bef3c7018d69636c87052a8
4
- data.tar.gz: 22573ae4c67684bc8e180876fe7485cf24baed19
3
+ metadata.gz: 12af76aabf22ca3fd21620ba445eec49e02bb148
4
+ data.tar.gz: e337dd929041aa42efbda91fd360caf0cb854035
5
5
  SHA512:
6
- metadata.gz: 074129e7c341baadf05037ef05b9bc3a7c72f0414e420d92b74f4e25acbb6a42da478bfb7d658e4150887156455cb71575e3a02d877be50a0a482210ef08c6e5
7
- data.tar.gz: c05121d91c8cd2f2a0d3a21e91fccb4a902b24b30bf8f594c6ef3f3c434b586422565cb526894632c10f91ea0248c9ca062d8b1afb8048ae64843bfaac7b9b01
6
+ metadata.gz: aa0037193fa2bb35abc47c05d51ad54f2d7c6f185e04ecd16332ca3b1749e67439429a69a1dbf73c15de1aa31fa21c603ea5d626c4fd6d788d3a64d4e14fc75d
7
+ data.tar.gz: a73e2d48d350b12c6a2b2108027845c9063de99a61ace81b7a0120cb22f55a39b769cf90b11c91fa58fed780215f6b6e66eb8c0a9b8311806fa86f2dd51b7b2a
@@ -1,48 +1,79 @@
1
- !https://travis-ci.org/ruby-json-schema/json-schema.svg?branch=master!:https://travis-ci.org/ruby-json-schema/json-schema
2
- !https://codeclimate.com/github/ruby-json-schema/json-schema/badges/gpa.svg!:https://codeclimate.com/github/ruby-json-schema/json-schema
1
+ ![https://travis-ci.org/ruby-json-schema/json-schema](https://travis-ci.org/ruby-json-schema/json-schema.svg?branch=master)
2
+ ![https://codeclimate.com/github/ruby-json-schema/json-schema](https://codeclimate.com/github/ruby-json-schema/json-schema/badges/gpa.svg)
3
3
 
4
- h1. Ruby JSON Schema Validator
4
+ Ruby JSON Schema Validator
5
+ ==========================
5
6
 
6
- This library is intended to provide Ruby with an interface for validating JSON objects against a JSON schema conforming to "JSON Schema Draft 4":http://tools.ietf.org/html/draft-zyp-json-schema-04. Legacy support for "JSON Schema Draft 3":http://tools.ietf.org/html/draft-zyp-json-schema-03, "JSON Schema Draft 2":http://tools.ietf.org/html/draft-zyp-json-schema-02, and "JSON Schema Draft 1":http://tools.ietf.org/html/draft-zyp-json-schema-01 is also included.
7
+ This library is intended to provide Ruby with an interface for validating JSON
8
+ objects against a JSON schema conforming to [JSON Schema Draft
9
+ 4](http://tools.ietf.org/html/draft-zyp-json-schema-04). Legacy support for
10
+ [JSON Schema Draft 3](http://tools.ietf.org/html/draft-zyp-json-schema-03),
11
+ [JSON Schema Draft 2](http://tools.ietf.org/html/draft-zyp-json-schema-02), and
12
+ [JSON Schema Draft 1](http://tools.ietf.org/html/draft-zyp-json-schema-01) is
13
+ also included.
7
14
 
8
- h2. Additional Resources
15
+ Additional Resources
16
+ --------------------
9
17
 
10
- * "Google Groups":https://groups.google.com/forum/#!forum/ruby-json-schema
11
- * #ruby-json-schema on chat.freenode.net
18
+ - [Google Groups](https://groups.google.com/forum/#!forum/ruby-json-schema)
19
+ - #ruby-json-schema on chat.freenode.net
12
20
 
13
- h2. Version 2.0.0 Upgrade Notes
21
+ Version 2.0.0 Upgrade Notes
22
+ ---------------------------
14
23
 
15
- Please be aware that the upgrade to version 2.0.0 will use Draft-04 *by default*, so schemas that do not declare a validator using the <code>$schema</code> keyword will use Draft-04 now instead of Draft-03. This is the reason for the major version upgrade.
24
+ Please be aware that the upgrade to version 2.0.0 will use Draft-04 **by
25
+ default**, so schemas that do not declare a validator using the `$schema`
26
+ keyword will use Draft-04 now instead of Draft-03. This is the reason for the
27
+ major version upgrade.
16
28
 
17
- h2. Installation
29
+ Installation
30
+ ------------
18
31
 
19
32
  From rubygems.org:
20
33
 
21
- <pre>
34
+ ```sh
22
35
  gem install json-schema
23
- </pre>
36
+ ```
24
37
 
25
38
  From the git repo:
26
39
 
27
- <pre>
40
+ ```sh
28
41
  $ gem build json-schema.gemspec
29
42
  $ gem install json-schema-2.5.2.gem
30
- </pre>
43
+ ```
31
44
 
45
+ Usage
46
+ -----
32
47
 
33
- h2. Usage
48
+ Three base validation methods exist:
34
49
 
35
- Three base validation methods exist: <code>validate</code>, <code>validate!</code>, and <code>fully_validate</code>. The first returns a boolean on whether a validation attempt passes and the second will throw a <code>JSON::Schema::ValidationError</code> with an appropriate message/trace on where the validation failed. The third validation method does not immediately fail upon a validation error and instead builds an array of validation errors return when validation is complete.
50
+ 1. `validate`: returns a boolean on whether a validation attempt passes
51
+ 2. `validate!`: throws a `JSON::Schema::ValidationError` with an appropriate message/trace on where the validation failed
52
+ 3. `fully_validate`: builds an array of validation errors return when validation is complete
36
53
 
37
- All methods take two arguments, which can be either a JSON string, a file containing JSON, or a Ruby object representing JSON data. The first argument to these methods is always the schema, the second is always the data to validate. An optional third options argument is also accepted; available options are used in the examples below.
54
+ All methods take two arguments, which can be either a JSON string, a file
55
+ containing JSON, or a Ruby object representing JSON data. The first argument to
56
+ these methods is always the schema, the second is always the data to validate.
57
+ An optional third options argument is also accepted; available options are used
58
+ in the examples below.
38
59
 
39
- By default, the validator uses the "JSON Schema Draft 4":http://tools.ietf.org/html/draft-zyp-json-schema-04 specification for validation; however, the user is free to specify additional specifications or extend existing ones. Legacy support for Draft 1, Draft 2, and Draft 3 is included by either passing an optional <code>:version</code> parameter to the <code>validate</code> method (set either as <code>:draft1</code> or <code>draft2</code>), or by declaring the <code>$schema</code> attribute in the schema and referencing the appropriate specification URI. Note that the <code>$schema</code> attribute takes precedence over the <code>:version</code> option during parsing and validation.
60
+ By default, the validator uses the [JSON Schema Draft
61
+ 4](http://tools.ietf.org/html/draft-zyp-json-schema-04) specification for
62
+ validation; however, the user is free to specify additional specifications or
63
+ extend existing ones. Legacy support for Draft 1, Draft 2, and Draft 3 is
64
+ included by either passing an optional `:version` parameter to the `validate`
65
+ method (set either as `:draft1` or `draft2`), or by declaring the `$schema`
66
+ attribute in the schema and referencing the appropriate specification URI. Note
67
+ that the `$schema` attribute takes precedence over the `:version` option during
68
+ parsing and validation.
40
69
 
41
- h3. Validate Ruby objects against a Ruby schema
70
+ ### Validate Ruby objects against a Ruby schema
42
71
 
43
- For further information on json schema itself refer to <a href="http://spacetelescope.github.io/understanding-json-schema/">Understanding JSON Schema</a>.
72
+ For further information on json schema itself refer to <a
73
+ href="http://spacetelescope.github.io/understanding-json-schema/">Understanding
74
+ JSON Schema</a>.
44
75
 
45
- <pre>
76
+ ```rb
46
77
  require 'rubygems'
47
78
  require 'json-schema'
48
79
 
@@ -59,32 +90,35 @@ data = {
59
90
  }
60
91
 
61
92
  JSON::Validator.validate(schema, data)
62
- </pre>
93
+ ```
63
94
 
64
- h3. Validate a JSON string against a JSON schema file
95
+ ### Validate a JSON string against a JSON schema file
65
96
 
66
- <pre>
97
+ ```rb
67
98
  require 'rubygems'
68
99
  require 'json-schema'
69
100
 
70
101
  JSON::Validator.validate('schema.json', '{"a" : 5}')
71
- </pre>
102
+ ```
72
103
 
73
- h3. Validate a list of objects against a schema that represents the individual objects
104
+ ### Validate a list of objects against a schema that represents the individual objects
74
105
 
75
- <pre>
106
+ ```rb
76
107
  require 'rubygems'
77
108
  require 'json-schema'
78
109
 
79
110
  data = ['user','user','user']
80
111
  JSON::Validator.validate('user.json', data, :list => true)
81
- </pre>
112
+ ```
82
113
 
83
- h3. Strictly validate an object's properties
114
+ ### Strictly validate an object's properties
84
115
 
85
- With the <code>:strict</code> option, validation fails when an object contains properties that are not defined in the schema's property list or doesn't match the <code>additionalProperties</code> property. Furthermore, all properties are treated as <code>required</code> regardless of <code>required</code> properties set in the schema.
116
+ With the `:strict` option, validation fails when an object contains properties
117
+ that are not defined in the schema's property list or doesn't match the
118
+ `additionalProperties` property. Furthermore, all properties are treated as
119
+ `required` regardless of `required` properties set in the schema.
86
120
 
87
- <pre>
121
+ ```rb
88
122
  require 'rubygems'
89
123
  require 'json-schema'
90
124
 
@@ -99,11 +133,11 @@ schema = {
99
133
  JSON::Validator.validate(schema, {"a" => 1, "b" => 2}, :strict => true) # ==> true
100
134
  JSON::Validator.validate(schema, {"a" => 1, "b" => 2, "c" => 3}, :strict => true) # ==> false
101
135
  JSON::Validator.validate(schema, {"a" => 1}, :strict => true) # ==> false
102
- </pre>
136
+ ```
103
137
 
104
- h3. Catch a validation error and print it out
138
+ ### Catch a validation error and print it out
105
139
 
106
- <pre>
140
+ ```rb
107
141
  require 'rubygems'
108
142
  require 'json-schema'
109
143
 
@@ -124,12 +158,11 @@ begin
124
158
  rescue JSON::Schema::ValidationError
125
159
  puts $!.message
126
160
  end
127
- </pre>
161
+ ```
128
162
 
163
+ ### Fully validate against a schema and catch all errors
129
164
 
130
- h3. Fully validate against a schema and catch all errors
131
-
132
- <pre>
165
+ ```rb
133
166
  require 'rubygems'
134
167
  require 'json-schema'
135
168
 
@@ -149,11 +182,11 @@ data = {
149
182
  errors = JSON::Validator.fully_validate(schema, data)
150
183
 
151
184
  # ["The property '#/a' of type String did not match the following type: integer in schema 03179a21-197e-5414-9611-e9f63e8324cd#", "The property '#/' did not contain a required property of 'b' in schema 03179a21-197e-5414-9611-e9f63e8324cd#"]
152
- </pre>
185
+ ```
153
186
 
154
- h3. Fully validate against a schema and catch all errors as objects
187
+ ### Fully validate against a schema and catch all errors as objects
155
188
 
156
- <pre>
189
+ ```rb
157
190
  require 'rubygems'
158
191
  require 'json-schema'
159
192
 
@@ -172,41 +205,40 @@ data = {
172
205
 
173
206
  errors = JSON::Validator.fully_validate(schema, data, :errors_as_objects => true)
174
207
 
175
- # [{:message=>"The property '#/a' of type String did not match the following type: integer in schema 03179a21-197e-5414-9611-e9f63e8324cd#", :schema=>#<URI::Generic:0x103a76198 URL:03179a21-197e-5414-9611-e9f63e8324cd#>, :failed_attribute=>"Type", :fragment=>"#/a"}, {:message=>"The property '#/' did not contain a required property of 'b' in schema 03179a21-197e-5414-9611-e9f63e8324cd#", :schema=>#<URI::Generic:0x103a76198 URL:03179a21-197e-5414-9611-e9f63e8324cd#>, :failed_attribute=>"Properties", :fragment=>"#/"}]
176
-
177
- </pre>
208
+ # [{:message=>"The property '#/a' of type String did not match the following type: integer in schema 03179a21-197e-5414-9611-e9f63e8324cd#", :schema=>#, :failed_attribute=>"Type", :fragment=>"#/a"}, {:message=>"The property '#/' did not contain a required property of 'b' in schema 03179a21-197e-5414-9611-e9f63e8324cd#", :schema=>#, :failed_attribute=>"Properties", :fragment=>"#/"}]
209
+ ```
178
210
 
179
- h3. Validate against a fragment of a supplied schema
211
+ ### Validate against a fragment of a supplied schema
180
212
 
181
- <pre>
182
- require 'rubygems'
183
- require 'json-schema'
213
+ ```rb
214
+ require 'rubygems'
215
+ require 'json-schema'
184
216
 
185
- schema = {
186
- "type" => "object",
187
- "required" => ["a","b"],
188
- "properties" => {
189
- "a" => {"type" => "integer"},
190
- "b" => {"type" => "string"},
191
- "c" => {
192
- "type" => "object",
193
- "properties" => {
194
- "z" => {"type" => "integer"}
195
- }
217
+ schema = {
218
+ "type" => "object",
219
+ "required" => ["a","b"],
220
+ "properties" => {
221
+ "a" => {"type" => "integer"},
222
+ "b" => {"type" => "string"},
223
+ "c" => {
224
+ "type" => "object",
225
+ "properties" => {
226
+ "z" => {"type" => "integer"}
196
227
  }
197
228
  }
198
229
  }
230
+ }
199
231
 
200
- data = {
201
- "z" => 1
202
- }
232
+ data = {
233
+ "z" => 1
234
+ }
203
235
 
204
- JSON::Validator.validate(schema, data, :fragment => "#/properties/c")
205
- </pre>
236
+ JSON::Validator.validate(schema, data, :fragment => "#/properties/c")
237
+ ```
206
238
 
207
- h3. Validate a JSON object against a JSON schema object, while also validating the schema itself
239
+ ### Validate a JSON object against a JSON schema object, while also validating the schema itself
208
240
 
209
- <pre>
241
+ ```rb
210
242
  require 'rubygems'
211
243
  require 'json-schema'
212
244
 
@@ -223,14 +255,16 @@ data = {
223
255
  }
224
256
 
225
257
  JSON::Validator.validate(schema, data, :validate_schema => true)
226
- </pre>
258
+ ```
227
259
 
228
- h3. Validate a JSON object against a JSON schema object, while inserting default values from the schema
260
+ ### Validate a JSON object against a JSON schema object, while inserting default values from the schema
229
261
 
230
- With the :insert_defaults option set to true any missing property that has a
231
- default value specified in the schema will be inserted into the validated data. The inserted default value is validated hence catching a schema that specifies an invalid default value.
262
+ With the `:insert_defaults` option set to true any missing property that has a
263
+ default value specified in the schema will be inserted into the validated data.
264
+ The inserted default value is validated hence catching a schema that specifies
265
+ an invalid default value.
232
266
 
233
- <pre>
267
+ ```rb
234
268
  require 'rubygems'
235
269
  require 'json-schema'
236
270
 
@@ -258,11 +292,11 @@ JSON::Validator.validate(schema, data, :insert_defaults => true)
258
292
  # "a" => 42,
259
293
  # "b" => 5
260
294
  # }
295
+ ```
261
296
 
262
- </pre>
263
- h3. Validate an object against a JSON Schema Draft 2 schema
297
+ ### Validate an object against a JSON Schema Draft 2 schema
264
298
 
265
- <pre>
299
+ ```rb
266
300
  require 'rubygems'
267
301
  require 'json-schema'
268
302
 
@@ -278,15 +312,23 @@ data = {
278
312
  }
279
313
 
280
314
  JSON::Validator.validate(schema, data, :version => :draft2)
281
- </pre>
315
+ ```
282
316
 
283
- h3. Explicitly specifying the type of the data
317
+ ### Explicitly specifying the type of the data
284
318
 
285
- By default, json-schema accepts a variety of different types for the data parameter, and it will try to work out what to do with it dynamically. You can pass it a string uri (in which case it will download the json from that location before validating), a string of JSON text, or simply a ruby object (such as an array or hash representing parsed json). However, sometimes the nature of the data is ambiguous (for example, is "http://github.com" just a string, or is it a uri?). In other situations, you have already parsed your JSON, and you don't need to re-parse it.
319
+ By default, json-schema accepts a variety of different types for the data
320
+ parameter, and it will try to work out what to do with it dynamically. You can
321
+ pass it a string uri (in which case it will download the json from that location
322
+ before validating), a string of JSON text, or simply a ruby object (such as an
323
+ array or hash representing parsed json). However, sometimes the nature of the
324
+ data is ambiguous (for example, is "http://github.com" just a string, or is it a
325
+ uri?). In other situations, you have already parsed your JSON, and you don't
326
+ need to re-parse it.
286
327
 
287
- If you want to be explict about what kind of data is being parsed, JSON schema supports a number of options:
328
+ If you want to be explict about what kind of data is being parsed, JSON schema
329
+ supports a number of options:
288
330
 
289
- <pre>
331
+ ```rb
290
332
  require 'rubygems'
291
333
  require 'json-schema'
292
334
 
@@ -305,13 +347,15 @@ JSON::Validator.validate(schema, '"https://api.github.com"', :json => true) # re
305
347
 
306
348
  # loads data from the uri
307
349
  JSON::Validator.validate(schema, 'https://api.github.com', :uri => true) # returns false
308
- </pre>
350
+ ```
309
351
 
310
- h3. Extend an existing schema and validate against it
352
+ ### Extend an existing schema and validate against it
311
353
 
312
- For this example, we are going to extend the "JSON Schema Draft 3":http://tools.ietf.org/html/draft-zyp-json-schema-03 specification by adding a 'bitwise-and' property for validation.
354
+ For this example, we are going to extend the [JSON Schema Draft
355
+ 3](http://tools.ietf.org/html/draft-zyp-json-schema-03) specification by adding
356
+ a 'bitwise-and' property for validation.
313
357
 
314
- <pre>
358
+ ```rb
315
359
  require 'rubygems'
316
360
  require 'json-schema'
317
361
 
@@ -357,13 +401,18 @@ data = {"a" => 1, "b" => 5}
357
401
  JSON::Validator.validate(schema,data) # => false
358
402
  data = {"a" => 0, "b" => "taco"}
359
403
  JSON::Validator.validate(schema,data) # => false
360
- </pre>
404
+ ```
361
405
 
362
- h3. Custom format validation
406
+ ### Custom format validation
363
407
 
364
- The JSON schema standard allows custom formats in schema definitions which should be ignored by validators that do not support them. JSON::Schema allows registering procs as custom format validators which receive the value to be checked as parameter and must raise a <code>JSON::Schema::CustomFormatError</code> to indicate a format violation. The error message will be prepended by the property name, e.g. "The property '#a'":
408
+ The JSON schema standard allows custom formats in schema definitions which
409
+ should be ignored by validators that do not support them. JSON::Schema allows
410
+ registering procs as custom format validators which receive the value to be
411
+ checked as parameter and must raise a `JSON::Schema::CustomFormatError` to
412
+ indicate a format violation. The error message will be prepended by the property
413
+ name, e.g. [The property '#a']()
365
414
 
366
- <pre>
415
+ ```rb
367
416
  require 'rubygems'
368
417
  require 'json-schema'
369
418
 
@@ -396,21 +445,26 @@ schema = {
396
445
  }
397
446
  }
398
447
  errors = JSON::Validator.fully_validate(schema, {"a" => "23"})
448
+ ```
399
449
 
400
- </pre>
401
-
402
- h2. Controlling Remote Schema Reading
450
+ Controlling Remote Schema Reading
451
+ ---------------------------------
403
452
 
404
- In some cases, you may wish to prevent the JSON Schema library from making HTTP calls or reading local files in order to resolve <code>$ref</code> schemas. If you fully control all schemas which should be used by validation, this could be accomplished by registering all referenced schemas with the validator in advance:
453
+ In some cases, you may wish to prevent the JSON Schema library from making HTTP
454
+ calls or reading local files in order to resolve `$ref` schemas. If you fully
455
+ control all schemas which should be used by validation, this could be
456
+ accomplished by registering all referenced schemas with the validator in
457
+ advance:
405
458
 
406
- <pre>
459
+ ```rb
407
460
  schema = JSON::Schema.new(some_schema_definition, Addressable::URI.parse('http://example.com/my-schema'))
408
461
  JSON::Validator.add_schema(schema)
409
- </pre>
462
+ ```
410
463
 
411
- If more extensive control is necessary, the <code>JSON::Schema::Reader</code> instance used can be configured in a few ways:
464
+ If more extensive control is necessary, the `JSON::Schema::Reader` instance used
465
+ can be configured in a few ways:
412
466
 
413
- <pre>
467
+ ```rb
414
468
  # Change the default schema reader used
415
469
  JSON::Validator.schema_reader = JSON::Schema::Reader.new(:accept_uri => true, :accept_file => false)
416
470
 
@@ -419,34 +473,47 @@ schema_reader = JSON::Schema::Reader.new(
419
473
  :accept_uri => proc { |uri| uri.host == 'my-website.com' }
420
474
  )
421
475
  JSON::Validator.validate(some_schema, some_object, :schema_reader => schema_reader)
422
- </pre>
476
+ ```
423
477
 
424
- The <code>JSON::Schema::Reader</code> interface requires only an object which responds to <code>read(string)</code> and returns a <code>JSON::Schema</code> instance. See the "API documentation":http://www.rubydoc.info/github/ruby-json-schema/json-schema/master/JSON/Schema/Reader for more information.
478
+ The `JSON::Schema::Reader` interface requires only an object which responds to
479
+ `read(string)` and returns a `JSON::Schema` instance. See the [API
480
+ documentation](http://www.rubydoc.info/github/ruby-json-schema/json-schema/master/JSON/Schema/Reader)
481
+ for more information.
425
482
 
426
- h2. JSON Backends
483
+ JSON Backends
484
+ -------------
427
485
 
428
- The JSON Schema library currently supports the <code>json</code> and <code>yajl-ruby</code> backend JSON parsers. If either of these libraries are installed, they will be automatically loaded and used to parse any JSON strings supplied by the user.
486
+ The JSON Schema library currently supports the `json` and `yajl-ruby` backend
487
+ JSON parsers. If either of these libraries are installed, they will be
488
+ automatically loaded and used to parse any JSON strings supplied by the user.
429
489
 
430
- If more than one of the supported JSON backends are installed, the <code>yajl-ruby</code> parser is used by default. This can be changed by issuing the following before validation:
490
+ If more than one of the supported JSON backends are installed, the `yajl-ruby`
491
+ parser is used by default. This can be changed by issuing the following before
492
+ validation:
431
493
 
432
- <pre>
494
+ ```rb
433
495
  JSON::Validator.json_backend = :json
434
- </pre>
496
+ ```
435
497
 
436
- Optionally, the JSON Schema library supports using the MultiJSON library for selecting JSON backends. If the MultiJSON library is installed, it will be autoloaded.
498
+ Optionally, the JSON Schema library supports using the MultiJSON library for
499
+ selecting JSON backends. If the MultiJSON library is installed, it will be
500
+ autoloaded.
437
501
 
438
- h2. Notes
502
+ Notes
503
+ -----
439
504
 
440
505
  The 'format' attribute is only validated for the following values:
441
506
 
442
- * date-time
443
- * date
444
- * time
445
- * ip-address (IPv4 address in draft1, draft2 and draft3)
446
- * ipv4 (IPv4 address in draft4)
447
- * ipv6
448
- * uri
449
-
450
- All other 'format' attribute values are simply checked to ensure the instance value is of the correct datatype (e.g., an instance value is validated to be an integer or a float in the case of 'utc-millisec').
507
+ - date-time
508
+ - date
509
+ - time
510
+ - ip-address (IPv4 address in draft1, draft2 and draft3)
511
+ - ipv4 (IPv4 address in draft4)
512
+ - ipv6
513
+ - uri
514
+
515
+ All other 'format' attribute values are simply checked to ensure the instance
516
+ value is of the correct datatype (e.g., an instance value is validated to be an
517
+ integer or a float in the case of 'utc-millisec').
451
518
 
452
519
  Additionally, JSON::Validator does not handle any json hyperschema attributes.
@@ -569,7 +569,7 @@ module JSON
569
569
  end
570
570
  Validator.add_schema(schema)
571
571
  else
572
- raise SchemaParseError, "Invalid schema - must be either a string or a hash"
572
+ raise JSON::Schema::SchemaParseError, "Invalid schema - must be either a string or a hash"
573
573
  end
574
574
 
575
575
  schema
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenny Hoxworth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -85,11 +85,11 @@ email: hoxworth@gmail.com
85
85
  executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files:
88
- - README.textile
88
+ - README.md
89
89
  - LICENSE.md
90
90
  files:
91
91
  - LICENSE.md
92
- - README.textile
92
+ - README.md
93
93
  - lib/json-schema.rb
94
94
  - lib/json-schema/attribute.rb
95
95
  - lib/json-schema/attributes/additionalitems.rb