Closed
Bug 775798
Opened 13 years ago
Closed 13 years ago
Remove "\u000a" escaping from the sync2.0 spec
Categories
(Cloud Services Graveyard :: Server: Sync, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: rfkelly, Assigned: rfkelly)
References
Details
(Whiteboard: [qa+])
Attachments
(1 file)
601 bytes,
patch
|
telliott
:
review+
|
Details | Diff | Splinter Review |
The spec currently defines application/newlines output as:
application/newlines: each BSO is sent as a separate JSON object on its own line. Newlines in the body of the BSO object are replaced by ‘\u000a’.
I don't think this is necessary. Any newlines in the BSO payload must already be escaped as "\n" for it to be valid JSON. The only place literal newlines could occur is as insignificant whitespace in the structure of the JSON, in which case we're better off just deleting them than trying to add extra bytes to escape them.
I propose we remove all discussion of the '\u000a' escaping. In the section on uploading application/newlines format data, we can add a note along the lines of "make sure your json library doesn't add newlines in an attempt to make the output human-readable".
Updated•13 years ago
|
Whiteboard: [qa+]
Comment 1•13 years ago
|
||
I think you're correct. As the payloads are currently constructed, a newline is impossible. I don't think you even need to call out the lack of escaping - we'll reject the payload upon submission.
Comment 2•13 years ago
|
||
+1 to removal.
If we find some client absolutely needs newlines because a JSON encoder is inserting them, we can add the feature back in.
Assignee | ||
Comment 3•13 years ago
|
||
Docs updated in https://github.com/mozilla-services/docs/commit/6f592c80f21e6996ee87bda9d4cd269979e6fa48
Code patch attached.
Attachment #644816 -
Flags: review?(telliott)
Updated•13 years ago
|
Attachment #644816 -
Flags: review?(telliott) → review+
Assignee | ||
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 5•13 years ago
|
||
Surely you could translate newlines into straight \n in the JSON payload? After all, they must be occurring outside of a literal string, so we can do whatever we like…
Updated•2 years ago
|
Product: Cloud Services → Cloud Services Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•