noi-techpark / it.bz.opendatahub.api.mobility-ninja

The new home of the Open Data Hub Mobility API v2
Other
2 stars 0 forks source link

Ninja: select json values with `shownull=true` gives duplicates, distinguish between JSON null and non-existent #18

Open Piiit opened 5 years ago

Piiit commented 5 years ago

We have a duplicate with "smetadata.state": null. One is about an existing JSON field inside smetadata, with a JSON null value, the other is a JSON object without a state key.

http://tomcat.testingmachine.eu/ninja/api/v2/flat/EChargingStation?shownull=true&select=smetadata.state gives

{
    "offset": 0,
    "data": [
        {
            "smetadata.state": null
        },
        {
            "smetadata.state": "TEMPORARYUNAVAILABLE"
        },
        {
            "smetadata.state": "UNKNOWN"
        },
        {
            "smetadata.state": "UNAVAILABLE"
        },
        {
            "smetadata.state": "AVAILABLE"
        },
        {
            "smetadata.state": "FAULT"
        },
        {
            "smetadata.state": "ACTIVE"
        },
        {
            "smetadata.state": "OCCUPIED"
        },
        {
            "smetadata.state": null
        },
        {
            "smetadata.state": "MAINTENANCE"
        }
    ],
    "limit": 200
}