Elle
Elle

Reputation: 73

Clone FIWARE DATA MODELS on my Orion Context Broker

I am trying to import all current FIWARE DATA MODELS on my Orion Context Broker (POST data to an Orion Context Broker instance using NGSIv2 API) as my base data models but when using exact json format provided in repository of data models - https://github.com/fiware/dataModels - as below, getting this error in my Restlet Client:

{ "error": "BadRequest", "description": "attribute must be a JSON object, unless keyValues option is used" }

This Payload is for PointOfInterest but same I'm getting same error for other FIWARE DATA MODELS as well:

POST http://localhost/v2/entities
Content-Type: application/json

{
        "id": "PointOfInterest-A-Concha-123456",
        "type": "PointOfInterest",
        "name": "Playa de a Concha",
        "description": "La Playa de A Concha se presenta como una continuación de la Playa de Compostela, una de las más frecuentadas de Vilagarcía.",
        "address": {
          "addressCountry": "ES",
          "addressLocality": "Vilagarcía de Arousa"
        },
        "category": ["113"],
        "location": {
          "type": "Point",
          "coordinates": [
            -8.768460000000001,
            42.60214472222222
          ]
        },
        "source": "http://www.tourspain.es",
        "refSeeAlso": ["Beach-A-Concha-123456"]
  }

Simply as FIWARE data models have been harmonized to enable data portability for different applications, I want to clone all current models to my orion context broker with my own data but can't use example json schema provide in repository.

I'm able to create simpler entities on Orion but not FIWARE DATA MODELS. Does anyone know what is wrong I'm doing?

Upvotes: 1

Views: 153

Answers (1)

fgalan
fgalan

Reputation: 12322

Try to add ?options=keyVaues to your request, I mean to use:

POST http://localhost/v2/entities?options=keyValues

Upvotes: 0

Related Questions