You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
12@Darin - but there is an order in the serialization. "{ id: 1, name: 'John' }" and "{ name: 'John', id: 1 }" are different as strings, which is what I care about here. Of course, the objects are equivalent when deserialized.Kevin Montrose– Kevin Montrose2010-07-25 21:09:21 +00:00Commented Jul 25, 2010 at 21:09
-
1@Darin - no, not in this case. I'm serializing something and then passing it along as a string to a service that only deals in strings (not JSON aware), and it'd be convenient for a variety of reasons for one field to appear first in the string.Kevin Montrose– Kevin Montrose2010-07-25 21:27:29 +00:00Commented Jul 25, 2010 at 21:27
-
1its good for testing also, being able to just look at the strings rather than having to deserialize.Steve– Steve2012-12-26 02:21:29 +00:00Commented Dec 26, 2012 at 2:21
-
9A stable serialization order is handy for cache validation too. It's trivial to take a checksum of a string - not true of a full object graph.solublefish– solublefish2015-03-06 19:25:39 +00:00Commented Mar 6, 2015 at 19:25
-
1Serialization order is also handy when doing unit tests so that you can easily say that expected vs actual response strings are equal even when the order of the json properties are different.anon– anon2017-04-11 15:55:21 +00:00Commented Apr 11, 2017 at 15:55
|
Show 7 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. python-3.x), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-cs