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

[BUG] in POST v2/subscriptions, if entities/type field exceed maximum length allowed #1965

Closed
iariasleon opened this issue Mar 29, 2016 · 1 comment
Assignees
Milestone

Comments

@iariasleon
Copy link
Contributor

in POST v2/subscriptions, if entities/type field exceed maximum length allowed, a new subscription is created. See "Field syntax restrictions" in reference.

Subscription request

POST http://localhost:1026/v2/subscriptions
Content-Type: application/json
Fiware-Service: test_entities_type
Fiware-ServicePath: /test
{"notification": {"callback": "http://localhost:1234", "attributes": ["temperture_0"]}, "expires": "2016-04-05T14:00:00.00Z", "subject": {"entities": [{"idPattern": ".*", "type": "lkPtXk0cVOCPgtJFwCeyW37AUMgfThau0No3NUqFUbIzjfK0NQqGUIolCQeEAA8unjuvyxKeQkK6GWAFrTkXW5ssy0atOitqzgpQqTv6tFfx2EoP9RaqJlqwfz4TgB0320CBE0rTvEs62iac3clGiyztRW7JiSZ0PkGFYluj6yZUq7t1LEa9RzIow0ywqmfyqFD4th44jVTYCevX5yySV4a6DwBdiVA0gu1J6PHvJTd5m11zuGU81SBANR9Yu8JHo"}], "condition": {"attributes": ["temperature_0"]}}}

subscription response

http code: 201
date: Tue, 29 Mar 2016 17:07:31 GMT
connection: Keep-Alive
content-length: 0
location: /v2/subscriptions/56fab653dbd225e095d4693d

doc in mongo:

{"reference": "http://localhost:1234", "throttling": 0L, "expression": {"q": "", "geometry": "", "georel": "", "coords": ""}, "format": "JSON", "entities": [{"type": "lkPtXk0cVOCPgtJFwCeyW37AUMgfThau0No3NUqFUbIzjfK0NQqGUIolCQeEAA8unjuvyxKeQkK6GWAFrTkXW5ssy0atOitqzgpQqTv6tFfx2EoP9RaqJlqwfz4TgB0320CBE0rTvEs62iac3clGiyztRW7JiSZ0PkGFYluj6yZUq7t1LEa9RzIow0ywqmfyqFD4th44jVTYCevX5yySV4a6DwBdiVA0gu1J6PHvJTd5m11zuGU81SBANR9Yu8JHo", "id": ".*", "isPattern": "true"}], "expiration": 1459864800L, "servicePath": "/test", "_id": ObjectId("56fab653dbd225e095d4693d"), "conditions": [{"type": "ONCHANGE", "value": ["temperature_0"]}], "attrs": ["temperture_0"]}

expected response

http code: 400
{"error":"BadRequest","description":"entity type length: 257, max length supported: 256"}
@iariasleon
Copy link
Contributor Author

LGTM

http code: 400 - Bad Request
headers:
   date: Fri, 17 Jun 2016 09:02:15 GMT
   fiware-correlator: 2f9f67e8-346a-11e6-8691-005056a20feb
   connection: Keep-Alive
   content-type: application/json
   content-length: 63
payload: {"error":"BadRequest","description":"max type length exceeded"}

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