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

in POST v2/op/update (batch op) not plain ascii chars are allowed in entitites.type #2664

Closed
iariasleon opened this issue Nov 14, 2016 · 2 comments

Comments

@iariasleon
Copy link
Contributor

in POST v2/op/update (batch op) not plain ascii chars are allowed in entitites.type. See similar issue: #2658.

Dataset used

      | entities_id |
      |-------------|
      | habitación  |
      | españa      |
      | barça       |

update batch operation request

url: POST http://localhost:1026/v2/op/update
headers:
    Content-Type: application/json
    Fiware-Service: test_op_update_entitiies_type_error
    Fiware-ServicePath: /test
payload: {"entities": [{"type": "barça", "temperature": {"type": "celsius", "value": "4", "metadata": {"alarm": {"type": "hot", "value": "warning"}}}, "id": "room_2"}], "actionType": "APPEND"}

Response

http code: 204 - No Content
headers:
   Connection: Keep-Alive
   Content-Length: 0
   Fiware-Correlator: 8bc03ac0-aa53-11e6-86e7-005056a20feb
   Date: Mon, 14 Nov 2016 10:17:28 GMT
payload:

Expected response

http code: 400 - Bad Request
{"error":"BadRequest","description":"Invalid characters in entity type"}

doc in mongo

{ "_id" : { "id" : "room_2", "type" : "habitación", "servicePath" : "/test" }, "attrNames" : [ "temperature" ], "attrs" : { "temperature" : { "type" : "celsius", "creDate" : 1479119813, "modDate" : 1479119813, "value" : "4", "md" : { "alarm" : { "type" : "hot", "value" : "warning" } }, "mdNames" : [ "alarm" ] } }, "creDate" : 1479119813, "modDate" : 1479119813 }
{ "_id" : { "id" : "room_2", "type" : "españa", "servicePath" : "/test" }, "attrNames" : [ "temperature" ], "attrs" : { "temperature" : { "type" : "celsius", "creDate" : 1479119813, "modDate" : 1479119813, "value" : "4", "md" : { "alarm" : { "type" : "hot", "value" : "warning" } }, "mdNames" : [ "alarm" ] } }, "creDate" : 1479119813, "modDate" : 1479119813 }
{ "_id" : { "id" : "room_2", "type" : "barça", "servicePath" : "/test" }, "attrNames" : [ "temperature" ], "attrs" : { "temperature" : { "type" : "celsius", "creDate" : 1479119813, "modDate" : 1479119813, "value" : "4", "md" : { "alarm" : { "type" : "hot", "value" : "warning" } }, "mdNames" : [ "alarm" ] } }, "creDate" : 1479119813, "modDate" : 1479119813 }
@fgalan
Copy link
Member

fgalan commented Nov 15, 2016

Fixed by PR #2679.

@iariasleon
Copy link
Contributor Author

LGTM

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

No branches or pull requests

2 participants