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

Task/part6 attribute value render #1325

Merged

Conversation

kzangeli
Copy link
Member

@kzangeli kzangeli commented Oct 6, 2015

Part 6 of #1259 - rendering of attribute value

@kzangeli kzangeli added this to the 0.25.0 milestone Oct 6, 2015
@@ -85,6 +85,7 @@ typedef struct ContextAttribute
std::string renderAsJsonObject(ConnectionInfo* ciP, RequestType request, const std::string& indent, bool comma, bool omitValue = false);
std::string renderAsNameString(ConnectionInfo* ciP, RequestType request, const std::string& indent, bool comma = false);
std::string toJson(bool isLastElement, bool types, const std::string& renderMode);
std::string toJsonAsValue(ConnectionInfo* ciP);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the different between toJson() and toJsonAsValue() ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally ContextAttribute is rendered as

"name": {
   "type": "x",
   "value": "123",
  ...

This new method I added for the case "GET /v2/entities/EEE/attr/attrrName/value", where only the value is rendered (and as standalone).
I could have added it to toJson(), with a new parameter, but it would make that method innecessarily complex.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NTC

@fgalan
Copy link
Member

fgalan commented Oct 6, 2015

LGTM

fgalan pushed a commit that referenced this pull request Oct 6, 2015
…_render

Task/part6 attribute value render
@fgalan fgalan merged commit 13751a8 into feature/1259_new_json_for_v2 Oct 6, 2015
@fgalan fgalan deleted the task/part6_attribute_value_render branch October 6, 2015 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants