-
Notifications
You must be signed in to change notification settings - Fork 91
remove cast by type after apply JEXL expression #1034
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
Changes from 10 commits
76e641d
363fb92
e9c32a8
f6d7537
35b19e1
d28e640
85f0af1
afacaa4
c6a1f70
086a53f
8f3ea37
297602a
dfdfbcb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "contextElements": [ | ||
| { | ||
| "type": "Light", | ||
| "isPattern": "false", | ||
| "id": "light1", | ||
| "attributes": [ | ||
| { | ||
| "name": "pressure", | ||
| "type": "Hgmm", | ||
| "value": 1040 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "updateAction": "UPDATE" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "contextElements": [ | ||
| { | ||
| "type": "WeatherStation", | ||
| "isPattern": "false", | ||
| "id": "ws1", | ||
| "attributes": [ | ||
| { | ||
| "name": "pressure", | ||
| "type": "Hgmm", | ||
| "value": 1040 | ||
| }, | ||
| { | ||
| "name": "humidity", | ||
| "type": "Percentage", | ||
| "value": "12" | ||
| }, | ||
| { | ||
| "name": "weather", | ||
| "type": "Summary", | ||
| "value": "Humidity 6 and pressure 1040" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "updateAction": "UPDATE" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "contextElements": [ | ||
| { | ||
| "type": "WeatherStation", | ||
| "isPattern": "false", | ||
| "id": "ws1", | ||
| "attributes": [ | ||
| { | ||
| "name": "pressure", | ||
| "type": "Hgmm", | ||
| "value": 1040 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "updateAction": "UPDATE" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,7 +192,7 @@ describe('Combine Jexl and legacy expressions (default JEXL)', function () { | |
| .matchHeader('fiware-servicepath', 'gardens') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have also a variant of this tests for ngsiv2 test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js That file doesn't need modifications? (looking to CI results, it seems it doesn't, but I wonder why...)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expressionCombinedTransformations-test.js includes tests which legacy and jexl expression, but not any of now not allowed cases:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have had a look into this with more detail. In test/unit/expressions/expressionCombinedTransformations-test.js (NGSIv1 variant) the only difference between old files (e.g. test/unit/examples/contextRequests/updateContextExpressionPlugin3.json) and new files (test/unit/examples/contextRequests/updateContextExpressionPlugin8.json) is that the old uses On the other hand test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js (NGSIv2 variant) already uses the native way, e.g. see test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin1.json. Thus, I think that explains that only test/unit/expressions/expressionCombinedTransformations-test.js is changed in this PR but not test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js NTC |
||
| .post( | ||
| '/v1/updateContext', | ||
| utils.readExampleFile('./test/unit/examples/contextRequests/updateContextExpressionPlugin3.json') | ||
| utils.readExampleFile('./test/unit/examples/contextRequests/updateContextExpressionPlugin3b.json') | ||
|
||
| ) | ||
| .reply( | ||
| 200, | ||
|
|
@@ -285,7 +285,7 @@ describe('Combine Jexl and legacy expressions (default Legacy)', function () { | |
| .matchHeader('fiware-servicepath', 'gardens') | ||
| .post( | ||
| '/v1/updateContext', | ||
| utils.readExampleFile('./test/unit/examples/contextRequests/updateContextExpressionPlugin3.json') | ||
| utils.readExampleFile('./test/unit/examples/contextRequests/updateContextExpressionPlugin3b.json') | ||
| ) | ||
| .reply( | ||
| 200, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any piece of documentation about this autocast feature that should be also removed/modified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is nothing about this autocast in https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/expressionLanguage.md#jexl-based-transformations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NTC