-
Notifications
You must be signed in to change notification settings - Fork 265
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/2948 wrong max one service path response #3034
Bug/2948 wrong max one service path response #3034
Conversation
Implemented toJson() method in SubscribeContextResponse, SubscribeError and SubscriptionId
…into bug/2948_wrong_max_one_service_path_response
- Fixed HttpStatusCode of the response - New test for the fixed issue added - New entry in CHANGES_NEXT_RELEASE added
*/ | ||
std::string SubscriptionId::toJson(RequestType container, bool comma) | ||
{ | ||
std::string xString = string; |
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.
We really choose a really bad name to store id string in Subscriptions.h... :)
NTC (just a bit surprised of my/our self :)
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.
This was probably me, smells KZ ... :-)
I don't find it that bad though :-D
NTC
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 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.
99% sure it's mine :-)
src/lib/ngsi/SubscriptionId.h
Outdated
@@ -47,6 +47,7 @@ typedef struct SubscriptionId | |||
const char* c_str(void) const; | |||
bool isEmpty(void); | |||
std::string render(RequestType container,bool comma); | |||
std::string toJson(RequestType container,bool comma); |
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.
Style: whitespace after ,
(I understand you take render() as reference, but it is also wrongly styled... could you please fix that line also, pls?)
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.
Fixed in 7480bca
*/ | ||
std::string SubscribeContextResponse::toJson(void) | ||
{ | ||
std::string out = ""; |
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.
Style: excesive whitepace here?
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.
[ Depends on what comes after. The '=' may be aligned with the '=' on the following line. If not, then yes ]
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.
Correct. In this case neither L66 (above) or L68 (below) has assignation stamente, thus my comment about excesive whitepace.
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.
Fixed in 7480bca
Good work! Only minor comments. Btw, do the branch in this PR pass |
src/lib/ngsi/SubscribeError.cpp
Outdated
} | ||
out += ","; | ||
out += JSON_PROP("affectedItems") + "[" + JSON_STR(subscriptionId.toJson(requestType, true)) + "]"; | ||
} |
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.
Indentation (one space seems to be missing)
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.
Fixed in 7480bca
src/lib/ngsi/SubscribeError.cpp
Outdated
(subscriptionId.get() != "000000000000000000000000") && | ||
(subscriptionId.get() != "")) | ||
{ | ||
out += ","; |
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.
Indentation
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.
Fixed in 7480bca
|
||
# | ||
# 01. Create subscription for E1 with multiple service paths header | ||
|
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.
This empty line to be removed
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.
Fixed in 7480bca
# | ||
|
||
echo "01. Create subscription for E1 with multiple service paths header" | ||
echo "==============================================================" |
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.
A few more '='s, to be as long as the preceding line
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.
Also, the description is not very correct.
Suggestion:
01. Attempt to create subscription for E1 with multiple service paths header, and see it fail
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.
Fixed in 7480bca
What Fermin said, good work! |
@arigliano no news on this PR since a week ago... Are the feedback comments clear? Do you need any extra clarification? Don't hesitate to ask if you need, please. |
…into bug/2948_wrong_max_one_service_path_response
Sorry for the late. With 7480bca commit, i've fixed the style issues.
I don't know if it is expected, but the errors in the part of code that I have modified are no longer there |
Try 'make style'. |
Ok thanks. I've performed '''make style''' and everything passed with no mayor error. |
LGTM. Thx! Passing the ball to @kzangeli for final LGTM |
LGTM |
This PR fixes #2948 Issue