8000 Error when create a custom notif with ngsi patch using a macro `${...}` in a attribute with type "DateTime" · Issue #4435 · telefonicaid/fiware-orion · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Error when create a custom notif with ngsi patch using a macro ${...} in a attribute with type "DateTime" #4435
@danielvillalbamota

Description

@danielvillalbamota

Bug description

Error date has invalid format when create a custom notif with ngsi patch using a macro in a attribute with type "DateTime".

  • Orion version: 3.10.0

How to reproduce it

  1. Create an entity this way:
curl --location 'http://orion_host:1026/v2/subscriptions' \
--header 'Fiware-Service: service' \
--header 'Fiware-ServicePath: /subservice' \
--header 'X-Auth-Token: g... \
--header 'Content-Type: application/json' \
--data '{
  "description": "DateTime test",
  "status": "active",
  "subject": {
    "entities": [
      {
        "idPattern": ".*",
        "type": "NoiseLevelObserved"
      }
    ],
    "condition": {
      "attrs": [
        "TimeInstant"
      ],
      "notifyOnMetadataChange": true
    }
  },
  "notification": {
    "attrs": [
      "dateobservedto"
    ],
    "onlyChangedAttrs": false,
    "attrsFormat": "normalized",
    "httpCustom": {
      "url": "http://host-cygnus:port/notify",
      "ngsi": {
        "dateobservedto": {
          "type": "DateTime",
          "value": "${TimeInstant}"
        }
      }
    }
  }
}'
  1. See error in the request response

400 Bad Request

{
  "error": "BadRequest",
  "description": "date has invalid format"
}

Expected behavior
Accept the macro expression in the value when the attribute's type is DateTime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0