Skip to content

Fix array json encoding for float values.#188

Open
mmeloni wants to merge 1 commit intojadell:masterfrom
mmeloni:patch-1
Open

Fix array json encoding for float values.#188
mmeloni wants to merge 1 commit intojadell:masterfrom
mmeloni:patch-1

Conversation

@mmeloni
Copy link

@mmeloni mmeloni commented Sep 25, 2017

There is a bug when json encoding float values inside array:
Ex "bbox":[-66.11667,-11,-66.11667,-11]
ex -11 -> -11 but in order to accomplish to https://neo4j.com/docs/rest-docs/current/#_arrays we need to have -11.0 to avoid Invalid JSON array in POST body error. It's enough add JSON_PRESERVE_ZERO_FRACTION to inside json_encode call.
This is mandatory to use spatial plugin with rest.

There is a bug when json encoding float values inside array:
Ex "bbox":[-66.11667,-11,-66.11667,-11]
ex -11 -> -11 but in order to accomplish to https://neo4j.com/docs/rest-docs/current/#_arrays we need to have -11.0 to avoid Invalid JSON array in POST body error. It's enough add JSON_PRESERVE_ZERO_FRACTION to inside json_encode call.
This is mandatory to use spatial plugin with rest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant