Comparison

teal-src/util/datamapper.tl @ 11470:5ebad952ebf7

util.datamapper: Fix to skip parsing wrapped arrays that aren't there Turns out the unreachable error is reachable :D
author Kim Alvefur <zash@zash.se>
date Mon, 22 Mar 2021 10:03:32 +0100
parent 11469:087d710ed520
child 11471:ab03de8e503e
comparison
equal deleted inserted replaced
11469:087d710ed520 11470:5ebad952ebf7
173 end 173 end
174 elseif value_where == "in_wrapper" and propschema is json_schema_object and proptype == "array" then 174 elseif value_where == "in_wrapper" and propschema is json_schema_object and proptype == "array" then
175 local wrapper = s:get_child(name, namespace); 175 local wrapper = s:get_child(name, namespace);
176 if wrapper then 176 if wrapper then
177 out[prop] = parse_array(propschema, wrapper); 177 out[prop] = parse_array(propschema, wrapper);
178 else
179 error "unreachable"
180 end 178 end
181 else 179 else
182 local value : string = extract_value (s, value_where, proptype, name, namespace, prefix, single_attribute, enums) 180 local value : string = extract_value (s, value_where, proptype, name, namespace, prefix, single_attribute, enums)
183 181
184 out[prop] = totype(proptype, value) 182 out[prop] = totype(proptype, value)