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

Support JSON arrays of arrays #640

Closed
nilium opened this issue Mar 9, 2020 · 1 comment
Closed

Support JSON arrays of arrays #640

nilium opened this issue Mar 9, 2020 · 1 comment

Comments

@nilium
Copy link
Contributor

nilium commented Mar 9, 2020

Currently, JSON arrays of arrays cannot be parsed by sops, leading to an unmarshaling error. Given the following input, for example:

{
	"ary": [[]]
}

sops will produce the following error:

[CMD]    ERRO[0094] Could not load tree, probably due to invalid syntax. Press a key to return to the editor, or Ctrl+C to exit.  error="Could not unmarshal input data: Expected JSON object key, got ] of type json.Delim instead"

The same input treated as YAML works, so the current workaround at least appears to be to use YAML.

nilium added a commit to nilium/sops that referenced this issue Mar 9, 2020
Add support for decoding JSON arrays of arrays by handling, during
slice decoding, when the next token is an array opening. This produces
nested []interface{} slices.

Closes getsops#640.
nilium added a commit to nilium/sops that referenced this issue Mar 9, 2020
Add support for decoding JSON arrays of arrays by handling, during
slice decoding, when the next token is an array opening. This produces
nested []interface{} slices.

Closes getsops#640.
nilium added a commit to nilium/sops that referenced this issue Mar 9, 2020
Add support for decoding JSON arrays of arrays by handling, during
slice decoding, when the next token is an array opening. This produces
nested []interface{} slices.

Closes getsops#640.
@nilium nilium changed the title Support arrays of arrays Support JSON arrays of arrays Mar 9, 2020
autrilla pushed a commit that referenced this issue Mar 20, 2020
Add support for decoding JSON arrays of arrays by handling, during
slice decoding, when the next token is an array opening. This produces
nested []interface{} slices.

Closes #640.
@ajvb
Copy link
Contributor

ajvb commented Apr 9, 2020

Fixed with #642

@ajvb ajvb closed this as completed Apr 9, 2020
rochaporto pushed a commit to rochaporto/sops that referenced this issue Jun 22, 2020
Add support for decoding JSON arrays of arrays by handling, during
slice decoding, when the next token is an array opening. This produces
nested []interface{} slices.

Closes getsops#640.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants