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

struct.to_json doesn't escape keys #10176

Closed
ashi009 opened this issue Nov 6, 2019 · 0 comments
Closed

struct.to_json doesn't escape keys #10176

ashi009 opened this issue Nov 6, 2019 · 0 comments
Labels
good first issue P3 We're not considering working on this, but happy to review a PR. (No assignee) type: bug

Comments

@ashi009
Copy link
Contributor

ashi009 commented Nov 6, 2019

Description of the problem / feature request:

struct.to_json doesn't escape keys.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

print(struct(**{ "\"": 1 }).to_json()) # outputs {""":1}

What operating system are you running Bazel on?

macOS

What's the output of bazel info release?

release 0.27.0

Have you found anything relevant by searching the web?

N/A

Any other information, logs, or outputs that you want to share?

Keys are not escaped.

@laurentlb laurentlb added good first issue P3 We're not considering working on this, but happy to review a PR. (No assignee) type: bug and removed untriaged labels Dec 16, 2019
dwhu added a commit to dwhu/bazel that referenced this issue Jan 14, 2020
Please let me know where to place an appopriate test. No existing test
class appeared appropriate as far as I could tell.
dwhu added a commit to dwhu/bazel that referenced this issue Feb 24, 2020
Please let me know where to place an appopriate test. No existing test
class appeared appropriate as far as I could tell.
dwhu added a commit to dwhu/bazel that referenced this issue Feb 24, 2020
Please let me know where to place an appopriate test. No existing test
class appeared appropriate as far as I could tell.
alandonovan pushed a commit to google/starlark-go that referenced this issue Mar 5, 2020
This change defines a standard Starlark module for JSON encoding and decoding.
See json.go for documentation.

It is intended to subsume, generalize, and eventually
replace Bazel's ill-conceived struct.to_json method.

The json module is predeclared in the Starlark REPL environment.

See related issues:
bazelbuild/bazel#7896
https://buganizer.corp.google.com/issues/23962735
https://buganizer.corp.google.com/issues/70210417
bazelbuild/bazel#7879 (comment)
bazelbuild/bazel#5542
bazelbuild/bazel#10176

Change-Id: I297ffaee9349eedeeb52f5a88f40636a4095f997
alandonovan pushed a commit to google/starlark-go that referenced this issue Mar 5, 2020
This change defines a standard Starlark module for JSON encoding and decoding.
See json.go for documentation.

It is intended to subsume, generalize, and eventually
replace Bazel's ill-conceived struct.to_json method.

The json module is predeclared in the Starlark REPL environment.

See related issues:
bazelbuild/bazel#7896
https://buganizer.corp.google.com/issues/23962735
https://buganizer.corp.google.com/issues/70210417
bazelbuild/bazel#7879 (comment)
bazelbuild/bazel#5542
bazelbuild/bazel#10176

Change-Id: I297ffaee9349eedeeb52f5a88f40636a4095f997
alandonovan pushed a commit to google/starlark-go that referenced this issue Mar 6, 2020
This change defines a standard Starlark module for JSON encoding and decoding.
See json.go for documentation.

It is intended to subsume, generalize, and eventually
replace Bazel's ill-conceived struct.to_json method.

The json module is predeclared in the Starlark REPL environment.

See related issues:
bazelbuild/bazel#7896
https://buganizer.corp.google.com/issues/23962735
https://buganizer.corp.google.com/issues/70210417
bazelbuild/bazel#7879 (comment)
bazelbuild/bazel#5542
bazelbuild/bazel#10176

Change-Id: I297ffaee9349eedeeb52f5a88f40636a4095f997
alandonovan pushed a commit to google/starlark-go that referenced this issue Jun 11, 2020
This change defines a standard Starlark module for JSON encoding and decoding.
See json.go for documentation.

It is intended to subsume, generalize, and eventually
replace Bazel's ill-conceived struct.to_json method.

The json module is predeclared in the Starlark REPL environment.

See related issues:
bazelbuild/bazel#7896
https://buganizer.corp.google.com/issues/23962735
https://buganizer.corp.google.com/issues/70210417
bazelbuild/bazel#7879 (comment)
bazelbuild/bazel#5542
bazelbuild/bazel#10176
bazelbuild/starlark#83
bazelbuild/bazel#3732

Change-Id: I297ffaee9349eedeeb52f5a88f40636a4095f997
alandonovan pushed a commit to google/starlark-go that referenced this issue Jun 11, 2020
This change defines a standard Starlark module for JSON encoding and decoding.
See json.go for documentation.

It is intended to subsume, generalize, and eventually
replace Bazel's ill-conceived struct.to_json method.

The json module is predeclared in the Starlark REPL environment.

See related issues:
bazelbuild/bazel#7896
https://buganizer.corp.google.com/issues/23962735
https://buganizer.corp.google.com/issues/70210417
bazelbuild/bazel#7879 (comment)
bazelbuild/bazel#5542
bazelbuild/bazel#10176
bazelbuild/starlark#83
bazelbuild/bazel#3732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue P3 We're not considering working on this, but happy to review a PR. (No assignee) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants