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

Convenience pretty-printing json output #186

Open
amoore877 opened this issue Mar 18, 2022 · 0 comments
Open

Convenience pretty-printing json output #186

amoore877 opened this issue Mar 18, 2022 · 0 comments

Comments

@amoore877
Copy link
Member

referencing Marshal functionality, like in

func (b *Bundle) Marshal() ([]byte, error) {

It would be a nice convenience if there we an option to get the json output in format like:

{
    "keys": [
        {
            "use": "x509-svid",
            "kty": "EC",
            "crv": "P-256",
            "x": "some_x",
            "y": "some_y",
            "x5c": [
                "a_cert"
            ]
        }
    ]
}

instead of the current result of

{"keys": [ {"use": "x509-svid","kty": "EC","crv": "P-256",...}

Not a critical issue, since consumers just have to use something like:

       import "encoding/json"
       ...
	var prettyJSON bytes.Buffer
	if err := json.Indent(&prettyJSON, currentMarshalBytesOutput, "", "    "); err != nil {
		return err
	}
	prettyBundleBytes := prettyJSON.Bytes()
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

No branches or pull requests

1 participant