json-schema 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZTJkNGU0NjgxNmU1MDcwNzNhZGM1ZmJkZDczZmQ3OWY2ZDIxNjE5MA==
5
+ data.tar.gz: !binary |-
6
+ NzNjZTFiODkyZTY3YThkNGM1ZTRkZTFiNzFkOWM0MDhjOTM3NjRiNA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MjFlZGQyMWYwYjYzZmFjYWQyZjBlMzRiMWU0MjhkYmE2MGY5OWNiZTMwYWU2
10
+ ZDJlOTViNzczMDI2ZWRhYzcwMjk2ZGQ5MjQ2YjMyMzQwY2M5MzA5MjA2YmU5
11
+ NjIyNjA0MjU2YzA5MDc3MWU3OTczYzc0NWMzODVlYjMyMjFlODE=
12
+ data.tar.gz: !binary |-
13
+ MjY2YTMwOTlkNjQyMzQwMGE4YjVmYjg2MGQ2ZGFhMWZjNDAwNmVkMDdlNTZm
14
+ YTk0NDk0YzA1NTQwMDk1YTBjOTU4MTllMDJhYTAyZGNjN2JjY2U5MDJhMDQ3
15
+ YjM1MTQzMjAyMjI4YTE2NGZhZWQyM2VjYzE5MWExM2Q0NmNkYTg=
@@ -22,7 +22,7 @@ From the git repo:
22
22
 
23
23
  <pre>
24
24
  $ gem build json-schema.gemspec
25
- $ gem install json-schema-2.2.2.gem
25
+ $ gem install json-schema-2.2.3.gem
26
26
  </pre>
27
27
 
28
28
 
@@ -56,6 +56,10 @@ module JSON
56
56
  schema.keys.each do |key|
57
57
  add_indifferent_access(schema[key])
58
58
  end
59
+ elsif schema.is_a?(Array)
60
+ schema.each do |schema_item|
61
+ add_indifferent_access(schema_item)
62
+ end
59
63
  end
60
64
  end
61
65
 
@@ -35,4 +35,34 @@ class RubySchemaTest < Test::Unit::TestCase
35
35
 
36
36
  assert(JSON::Validator.validate(schema, data))
37
37
  end
38
- end
38
+
39
+ def test_symbol_keys_in_hash_within_array
40
+ schema = {
41
+ type: 'object',
42
+ properties: {
43
+ a: {
44
+ type: "array",
45
+ items: [
46
+ {
47
+ properties: {
48
+ b: {
49
+ type: "integer"
50
+ }
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ }
57
+
58
+ data = {
59
+ a: [
60
+ {
61
+ b: 1
62
+ }
63
+ ]
64
+ }
65
+
66
+ assert(JSON::Validator.validate(schema, data, :validate_schema => true))
67
+ end
68
+ end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
5
- prerelease:
4
+ version: 2.2.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kenny Hoxworth
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-08 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description:
15
14
  email: hoxworth@gmail.com
@@ -114,27 +113,26 @@ files:
114
113
  homepage: http://github.com/hoxworth/json-schema/tree/master
115
114
  licenses:
116
115
  - MIT
116
+ metadata: {}
117
117
  post_install_message:
118
118
  rdoc_options: []
119
119
  require_paths:
120
120
  - lib
121
121
  required_ruby_version: !ruby/object:Gem::Requirement
122
- none: false
123
122
  requirements:
124
123
  - - ! '>='
125
124
  - !ruby/object:Gem::Version
126
125
  version: '0'
127
126
  required_rubygems_version: !ruby/object:Gem::Requirement
128
- none: false
129
127
  requirements:
130
128
  - - ! '>='
131
129
  - !ruby/object:Gem::Version
132
130
  version: '0'
133
131
  requirements: []
134
132
  rubyforge_project:
135
- rubygems_version: 1.8.23
133
+ rubygems_version: 2.0.7
136
134
  signing_key:
137
- specification_version: 3
135
+ specification_version: 4
138
136
  summary: Ruby JSON Schema Validator
139
137
  test_files:
140
138
  - test/test_all_of_ref_schema.rb