json_schemer 0.2.5 → 0.2.6

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
  SHA256:
3
- metadata.gz: dd79033e749c1e3077636935feed34452d51b528b89acef5e35d07871f6ab9c0
4
- data.tar.gz: 355a3bb6aae3ea6c29047c69d0f64d3481bfa265453b6a495788d4a963715abd
3
+ metadata.gz: 6fb7d3d8b50f87d5e08647aedbbfc850e7c7378283923c41deb5ea42b69a38f8
4
+ data.tar.gz: '09a4c42ee2ba22422c57d7c4591745931d0bd7d6455dfb0c2e377e9cf7521a0f'
5
5
  SHA512:
6
- metadata.gz: fce9c0f1ceb00466f7da2a1692fb1fb78382c5d82f8bc6995bb81af0c6a1f362e5602b2574fbe4429e661b29c89f6af16cf8871cba8893f5439c1a5079126887
7
- data.tar.gz: fdc5f5968f05fa551939c22c0dfe66226e2cec18bcdc53aa567287b89b1fc00f8599d8cb5a3e8a19c2822ebe6601aea47a0a9b97a82529f3a1fb3e0c601c9673
6
+ metadata.gz: 146e560ae96d8f33640c51a1f6bc77e110ba45da5a41b08e0b5a139c65520680a65fc10e79e19cf204222bc8f1d0a1dadde5be6f4c9def1bba2d644ee4980795
7
+ data.tar.gz: ec892824f0b350015dec49ed380df33247d9f1cd0d78a6a36488828f90adbf7f2f0232cd0f843b4a1e7d1e096738861127648f4a84378a3885cb1d3e16ae1dd7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- json_schemer (0.2.5)
4
+ json_schemer (0.2.6)
5
5
  ecma-re-validator (~> 0.2)
6
6
  hana (~> 1.3)
7
7
  regexp_parser (~> 1.5)
@@ -36,7 +36,7 @@ module JSONSchemer
36
36
  keywords: nil,
37
37
  ref_resolver: DEFAULT_REF_RESOLVER
38
38
  )
39
- raise InvalidSymbolKey, 'schemas must use string keys' if schema.is_a?(Hash) && !schema.first.first.is_a?(String)
39
+ raise InvalidSymbolKey, 'schemas must use string keys' if schema.is_a?(Hash) && !schema.empty? && !schema.first.first.is_a?(String)
40
40
  @root = schema
41
41
  @format = format
42
42
  @insert_property_defaults = insert_property_defaults
@@ -467,9 +467,9 @@ module JSONSchemer
467
467
  dependencies = schema['dependencies']
468
468
  property_names = schema['propertyNames']
469
469
 
470
- if insert_property_defaults?
470
+ if insert_property_defaults? && properties
471
471
  properties.each do |property, property_schema|
472
- if !data.key?(property) && property_schema.key?('default')
472
+ if !data.key?(property) && property_schema.is_a?(Hash) && property_schema.key?('default')
473
473
  data[property] = property_schema.fetch('default').clone
474
474
  end
475
475
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module JSONSchemer
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.6'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_schemer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Harsha
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-11 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -153,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  requirements: []
156
- rubyforge_project:
157
- rubygems_version: 2.7.6
156
+ rubygems_version: 3.0.3
158
157
  signing_key:
159
158
  specification_version: 4
160
159
  summary: JSON Schema validator. Supports drafts 4, 6, and 7.