Closed kanemathers closed 4 years ago
Tested with the cURL:
curl -X GET \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer KEYSUPERSECRET" \
--globoff "http://localhost:12111/v2/number_orders?filter[phone_numbers.phone_number]=%22B18665552368"
and it worked. LGTM
Fixes #7
There's two different ways one can specify GET filters in the openapi schema:
1:
2:
The difference being a flat listing of filter properties vs a nested schema of properties.
This causes a problem with
telnyx-mock
as the HTTP server does some work to unroll the GET parameters into a nestedmap
structure. See./param/nestedtypeassembler/nestedtypeassembler.go
>If the openapi spec uses the flat property structure and we try to pass in the nested
map
, built bynestedtypeassembler
, we get validation errors fromgo-jsval
as it fails to compare the two inputs.This commit introduces a check to keep track of nested vs flat openapi specs and ensures
go-jsval
is properly passed either the nested GET parameters or we flatten them.