committee 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,11 +12,12 @@ module Committee
12
12
  def call(headers, data)
13
13
  check_content_type!(headers)
14
14
 
15
- if @link.rel == "instances"
15
+ if @link.rel == "instances" && !@link.target_schema
16
16
  if !data.is_a?(Array)
17
17
  raise InvalidResponse, "List endpoints must return an array of objects."
18
18
  end
19
19
  # only consider the first object during the validation from here on
20
+ # (but only in cases where `targetSchema` is not set)
20
21
  data = data[0]
21
22
  end
22
23
 
@@ -28,6 +28,7 @@ describe Committee::ResponseValidator do
28
28
 
29
29
  it "detects an improperly formatted list response" do
30
30
  @link = @list_link
31
+ @link.target_schema = nil
31
32
  e = assert_raises(Committee::InvalidResponse) { call }
32
33
  message = "List endpoints must return an array of objects."
33
34
  assert_equal message, e.message
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: committee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-28 00:00:00.000000000 Z
13
+ date: 2014-06-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json_schema