Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when create a custom notif with ngsi patch using a macro ${...} in a attribute with type "DateTime" #4435

Closed
danielvillalbamota opened this issue Oct 16, 2023 · 3 comments
Labels
Milestone

Comments

@danielvillalbamota
Copy link
Collaborator

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.

@mrutid
Copy link
Member

mrutid commented Oct 16, 2023

Include in the fix other attribute types that may behave in the same way: type:"geo:json"

@fgalan
Copy link
Member

fgalan commented Oct 16, 2023

PR #4436

@fgalan fgalan added this to the 3.11.0 milestone Oct 16, 2023
@danielvillalbamota
Copy link
Collaborator Author

It works right. I close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants