Search code examples
fiwarefiware-orion

Fiware orion invalid date format


I have question regarding DateTime, can this be left empty for example

{ value: '',
  type: 'DateTime',
  metadata: {}
}

I am getting error when sending entity with this attribute that date is invalid format. This is clear as day why but what format i would have to use for empty value.

I failed to find this information on documentation but i could miss it.

Thanks.


Solution

  • You cannot use an empty value for DateTime attributes in NGSIv2 API. You have to provide a properly formatted date in ISO8601 format.

    If you need to introduce the "no date" semantics in your system the best approach is to remove the attribute (e.g. DELETE /v2/entities/E/attrs/A if I'm remembering correctly).