Closed kenkoooo closed 3 years ago
According to the API document, the type of the coordinates field in the bounding box object is "Array of Array of Array of Float" like the following: https://developer.twitter.com/en/docs/twitter-api/premium/data-dictionary/object-model/geo
coordinates
{ "coordinates": [[ [ -74.026675, 40.683935 ], [ -74.026675, 40.877483 ], [ -73.910408, 40.877483 ], [ -73.910408, 40.3935 ] ]] }
We can parse it correctly, but we can not serialize it to JSON correctly. The coordinates value of a serialized JSON object will be "Array of Array of Float" like the following:
{ "coordinates": [ [ -74.026675, 40.683935 ], [ -74.026675, 40.877483 ], [ -73.910408, 40.877483 ], [ -73.910408, 40.3935 ] ] }
In this PR, I fixed the serializer and added a test for it.
Thanks, LGTM
Thank you for the review!
According to the API document, the type of the
coordinates
field in the bounding box object is "Array of Array of Array of Float" like the following: https://developer.twitter.com/en/docs/twitter-api/premium/data-dictionary/object-model/geoWe can parse it correctly, but we can not serialize it to JSON correctly. The
coordinates
value of a serialized JSON object will be "Array of Array of Float" like the following:In this PR, I fixed the serializer and added a test for it.