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

Getting/setting attribute values as text #1179

Closed
fgalan opened this issue Aug 14, 2015 · 3 comments
Closed

Getting/setting attribute values as text #1179

fgalan opened this issue Aug 14, 2015 · 3 comments

Comments

@fgalan
Copy link
Member

fgalan commented Aug 14, 2015

Getting an attribute value encoded as text:

  • Operation: GET /v2/entities//attrs//value
  • Text is returned when text/plain is in Accept with more priority than application/json (check Accept header rules in the HTTP specification) or "options=text" is used (overriding the Accept header).
  • Attribute values using number or booleans as native JSON type are translated to text at rendering time.

Setting an attribute value encoded as text:

  • Operation: PUT /v2/entities//attrs//value
  • The payload is considered as text if Content-Type is text/plain
  • The serviceRoutine dealing with this should apply a heuristic, so if the text is a valid number it will be passed as number to mongoBackend (the same will apply in the future for dates Using special type "date", should be converted to ISODate() in mongo? #1107, once it is implemented).

Related with (more broad): #1001

@fgalan fgalan added this to the 0.24.0 milestone Aug 14, 2015
@fgalan
Copy link
Member Author

fgalan commented Aug 14, 2015

If the value attribute is a compound value, getting such attribute value as text will return an "string-fication" of the JSON.

@crbrox crbrox self-assigned this Aug 17, 2015
@fgalan fgalan modified the milestones: 0.24.0, 0.25.0 Sep 8, 2015
@fgalan
Copy link
Member Author

fgalan commented Sep 17, 2015

PR #1182 completed the "getting" par of the issue.

Regarding the "setting" part, it is better to defer to 0.26.0, as currently is being discussed the final behaviour of such operation.

@fgalan fgalan modified the milestones: 0.26.0, 0.25.0 Sep 17, 2015
@fgalan fgalan modified the milestones: 0.25.0, 0.26.0 Sep 21, 2015
@fgalan fgalan modified the milestones: 1259-cluster, 0.25.0 Oct 5, 2015
@fgalan fgalan modified the milestones: 0.27.0, 1259-cluster Jan 28, 2016
@fgalan
Copy link
Member Author

fgalan commented Jan 28, 2016

Actually, this was part of #1259. Thus, closing.

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