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

encoding/json: doc on valid key names is outdated #15317

Closed
glasser opened this issue Apr 15, 2016 · 6 comments
Closed

encoding/json: doc on valid key names is outdated #15317

glasser opened this issue Apr 15, 2016 · 6 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@glasser
Copy link
Contributor

glasser commented Apr 15, 2016

On master, the documentation for json.Marshal says:

// The key name will be used if it's a non-empty string consisting of
// only Unicode letters, digits, dollar signs, percent signs, hyphens,
// underscores and slashes.

However, this is quite outdated. The current list of allowed characters consists of letters, digits, space, and these punctuation characters: !#$%&()*+-./:<=>?@[]^_{|}~

I'm happy to send a Gerrit CL to fix this but am curious about what people think would be better: literally listing this set of characters, or saying something like "most punctuation characters, excluding backslash, quotes, and comma"?

@bradfitz bradfitz added this to the Go1.7 milestone Apr 15, 2016
@bradfitz
Copy link
Contributor

What are you trying to link to? There is no line 7540 in that file?

@glasser
Copy link
Contributor Author

glasser commented Apr 15, 2016

Whoops, my fingers must have slipped and added an extra 0. Link fixed.

@bradfitz
Copy link
Contributor

I see. Yeah, I don't think we want that soup of punctuation near English.

@glasser
Copy link
Contributor Author

glasser commented Apr 15, 2016

Something like:

Valid key names can contain Unicode letters, digits, spaces, and some punctuation marks (not including quotes, backslash, or comma). If the key name is not valid, the default name is used.

?

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label May 26, 2016
@rsc
Copy link
Contributor

rsc commented May 27, 2016

This is the right text (fix the text, don't rewrite it):

// The key name will be used if it's a non-empty string consisting of
// only Unicode letters, digits, and ASCII punctuation except quotation
// marks, backslash, and comma.

@rsc rsc modified the milestones: Go1.7Maybe, Go1.7 May 27, 2016
@gopherbot
Copy link

CL https://golang.org/cl/23691 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants