neo4jphp icon indicating copy to clipboard operation
neo4jphp copied to clipboard

Fix array json encoding for float values.

Open mmeloni opened this issue 7 years ago • 0 comments

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.

mmeloni avatar Sep 25 '17 14:09 mmeloni