jadell / neo4jphp

PHP wrapper of the Neo4j REST interface
Other
532 stars 137 forks source link

Fix array json encoding for float values. #188

Open mmeloni opened 7 years ago

mmeloni commented 7 years ago

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.