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

Valid keys for json.Mashall #2718

Closed
gopherbot opened this issue Jan 16, 2012 · 4 comments
Closed

Valid keys for json.Mashall #2718

gopherbot opened this issue Jan 16, 2012 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by aschobel:

encoding/json.Mashall doesn't encode a field if the tag has a '/' in it
 
type SubscriptiontrackHandlerSettings struct { 
        Enable    int    `json:"enable"` 
        TextHtml  string `json:"text/html"` 
        TextPlain string `json:"text/plain"` 
} 

http://weekly.golang.org/src/pkg/encoding/json/encode.go?s=3491:3534#L415

A JSON object should be able to have a key with a '/' in if you look 
at http://www.json.org/ 

The API in question is SendGrid's: 
http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/

Discussion
https://groups.google.com/group/golang-nuts/browse_thread/thread/2a806c73457c4638
@rsc
Copy link
Contributor

rsc commented Jan 16, 2012

Comment 1:

yuck.  it's okay to expand the allowed characters to include % and /.

@adg
Copy link
Contributor

adg commented Jan 16, 2012

Comment 2:

Labels changed: added priority-go1, removed priority-triage.

Owner changed to builder@golang.org.

Status changed to Accepted.

@bradfitz
Copy link
Contributor

Comment 3:

http://golang.org/cl/5532095

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz
Copy link
Contributor

Comment 4:

This issue was closed by revision b39c883.

Status changed to Fixed.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants