FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
50 stars 41 forks source link

Crash with this Entity and content-type: application/json #131

Open jmcanterafonseca opened 5 years ago

jmcanterafonseca commented 5 years ago

payload

{
    "id": "urn:ngsi-ld:Building:store00221",
    "type": "Building",
    "category":{
        "type": "Property",
        "value": ["commercial"]
    },
    "address": {
        "type": "Property",
        "value": {
            "streetAddress": "Bornholmer Straße 65",
            "addressRegion": "Berlin",
            "addressLocality": "Prenzlauer Berg",
            "postalCode": "10439"
        }
    },
    "location": {
        "type": "GeoProperty",
        "value": {
             "type": "Point",
             "coordinates": [13.3986, 52.5547]
        }
    },
    "name": {
        "type": "Property",
        "value": "Bösebrücke Einkauf"
    },
    "@context": [
        "https://schema.lab.fiware.org/ld/context",
        "http://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
    ]
}
jmcanterafonseca commented 5 years ago

this should result in an error instead of crashing ... as MIME type is application/json and we are providing an @context in the payload

kzangeli commented 5 years ago

In my Ubuntu the response is like this;

HTTP/1.1 400 Bad Request
Content-Length: 191
Content-Type: application/json
Date: Tue, 09 Jul 2019 13:45:58 GMT

{
    "details": "For @context in payload, the MIME type must be application/ld+json",
    "title": "Invalid MIME-type for @context in payload",
    "type": "http://uri.etsi.org/ngsi-ld/errors/BadRequestData"
}

Need more info.