When creating an entity you could do it like this :
curl --location --request POST 'https://my.api/v2/entities/?options=keyValues' --header 'Content-Type: application/json' --data-raw '{
"id":"vehicle:WasteManagement:1",
"type":"WasteManagement",
"vehicleType":"lorry"
}'
Or without the options=KeyValues parameter :
curl --location --request POST 'https://my.api/v2/entities/' --header 'Content-Type: application/json' --data-raw '{
"id":"vehicle:WasteManagement:2",
"type":"WasteManagement",
"vehicleType":{
"value": "lorry"
}
}'
And in both case the entity is the same. But I don't manage to create an entity with a options=keyValues parameter with an entity that has a 'location' attribute : when doing
curl --location --request POST 'https://my.api/v2/entities/' --header 'Content-Type: application/json' --data-raw '{
"id":"vehicle:WasteManagement:3",
"type":"WasteManagement",
"vehicleType":"lorry",
"location": {
"type": "Point",
"coordinates": [
-0.56832066,
47.49576
]
}
}'
In this case, the result from curl --location --request GET https://my.api/v2/entities/vehicle:WasteManagement:2'
Would be
"location": {
"type": "StructuredValue",
"value": {
"type": "Point",
"coordinates": [
-3.164485592,
40.627851337
]
},
"metadata": {}
},
And the type of location is StructuredValue
My expectation would be geo:point
or other geo:XXX depending of the type of the GeoJSON which allow the entity to be geolocalized and filter by location.
?options=keyValues
. Otherwise Orion returns:{"error":"BadRequest","description":"attribute must be a JSON object, unless keyValues option is used"}
. I'd recommend to edit the question post to fix it. – fgalan