-
Notifications
You must be signed in to change notification settings - Fork 266
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
option to return ServicePath in entity response #2877
Comments
This would definitely be a nice feature. |
Thanks for the contribution. However, I'd suggest to implement it as a virtual attribute, i.e.
or (if you want the servicePath, along any other attribute, following the general rules for virtual attributes):
|
@fgalan yes, that would be perfect |
Hi, I tried to implement it, but I have a small problem. When I read it, the service path is the empty string. |
The Anyway, the servicePath virtual attribute should be implemented in a similar way other virtual attributes. Have a look to how DATE_CREATED (corresponding to |
@fgalan for me it's not clear where I should get the service path from. In the database it's at the same level than id and type. |
I don't think so. Probably the best approach is to modify the ContextElementResponse constructor.
This constructor uses a BSON that comes from DB (in the Probably you would need to add a |
@fgalan I don't see the booleans in the current constructor: Also, the servicePath is already decoded from the BSON as far as I can see... |
I did a pull request here:
Unfortunately in the following weeks, I will have no time... |
You are right... my feedback was based in an old version of the code (corresponding to release/1.4.0 branch, https://github.com/telefonicaid/fiware-orion/blob/release/1.4.0/src/lib/ngsi/ContextElementResponse.cpp#L133) but the modern version in master simplified the mechanism, so no such booleans are used in the constructor signature. Sorry for the confussion... Side-note (as this is not directly related with the service path stuff, but with hwo creation/modification date virtual attributes work): with the current mechanism, the mongoBackend sets the BSON virtual attributes with creation and modification dates at BSON building time. Note also that the processing done on ContextElementResponse to set creDate/modDate in the contained EntityId object is done to make these fields available to the matching logic used to check filters upon subscription notifications. |
I understand you refer to:
That's correct. However, not that that |
At the end, and taken into account the functionality available in Orion 3.8.0, this issue is not actually needed, as it is covered by
Thus, the issue is going to be closed. If due to whaever reason we need to re-open it, note the following PR (authored by @chetan-NEC ) proposes a solution and can be useful in that case. |
Is it not true that you can give an array of service-paths in a GET /v2/entities request? |
Your are right (that's not a primary use case, so I didn't think on it in the first time ;) @chetan-NEC we are going to reopen issue and PR. Sorry for the inconveniences... |
PR #4329 |
Hi,
this is a feature request to add an option to return the servicePath in the entity response.
For example:
would return:
Including the service path in the response would allow the user to perform actions on the returned entities.
The text was updated successfully, but these errors were encountered: