@@ -88,22 +88,24 @@ def roundtrip(operation, hash)
8888 let ( :operation ) { client . operation ( :GetEvent ) }
8989
9090 it 'sets list flag and itemType on list-derived attributes' do
91- elements = operation . contract . response . body . elements
92- tags = elements . first . attributes . find { |a | a . name == 'tags' }
93- scores = elements . first . attributes . find { |a | a . name == 'scores' }
94-
95- expect ( tags . list? ) . to be true
96- expect ( tags . base_type ) . to eq 'xsd:string'
97- expect ( scores . list? ) . to be true
98- expect ( scores . base_type ) . to eq 'xsd:int'
91+ paths = operation . contract . response . body . paths
92+ root = paths . find { |p | p [ :path ] . size == 1 }
93+ tags = root [ :attributes ] . find { |a | a [ :name ] == 'tags' }
94+ scores = root [ :attributes ] . find { |a | a [ :name ] == 'scores' }
95+
96+ expect ( tags [ :list ] ) . to be true
97+ expect ( tags [ :type ] ) . to eq 'xsd:string'
98+ expect ( scores [ :list ] ) . to be true
99+ expect ( scores [ :type ] ) . to eq 'xsd:int'
99100 end
100101
101102 it 'uses first memberType for union-derived attributes' do
102- elements = operation . contract . response . body . elements
103- code = elements . first . attributes . find { |a | a . name == 'code' }
103+ paths = operation . contract . response . body . paths
104+ root = paths . find { |p | p [ :path ] . size == 1 }
105+ code = root [ :attributes ] . find { |a | a [ :name ] == 'code' }
104106
105- expect ( code . list? ) . to be false
106- expect ( code . base_type ) . to eq 'xsd:string'
107+ expect ( code [ : list] ) . to be false
108+ expect ( code [ :type ] ) . to eq 'xsd:string'
107109 end
108110
109111 it 'round-trips list attributes with whitespace splitting and type coercion' do
@@ -167,10 +169,10 @@ def roundtrip(operation, hash)
167169 let ( :operation ) { client . operation ( :GetMeasurement ) }
168170
169171 it 'uses first member type as base_type' do
170- elements = operation . contract . response . body . elements
171- value_el = elements . first . children . find { |c | c . name == 'value' }
172+ paths = operation . contract . response . body . paths
173+ value = paths . find { |p | p [ :path ] . last == 'value' }
172174
173- expect ( value_el . base_type ) . to eq 'xsd:string'
175+ expect ( value [ :type ] ) . to eq 'xsd:string'
174176 end
175177
176178 it 'round-trips response data' do
@@ -188,11 +190,11 @@ def roundtrip(operation, hash)
188190 let ( :operation ) { client . operation ( :GetTags ) }
189191
190192 it 'marks list elements with list flag' do
191- elements = operation . contract . response . body . elements
192- tags = elements . first . children . find { |c | c . name == 'tags' }
193+ paths = operation . contract . response . body . paths
194+ tags = paths . find { |p | p [ :path ] . last == 'tags' }
193195
194- expect ( tags . list? ) . to be true
195- expect ( tags . base_type ) . to eq 'xsd:string'
196+ expect ( tags [ : list] ) . to be true
197+ expect ( tags [ :type ] ) . to eq 'xsd:string'
196198 end
197199
198200 it 'round-trips string list values' do
0 commit comments