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

Store and retrieve raw JSON response from server #19

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Aug 19, 2023

For the CLI, it'd be helpful to print the original JSON sent from the server. Currently, the Go objects are decoded from the server JSON and re-encoded into JSON, which would omit any fields that aren't accounted for in the model.

This PR adds an internal rawJSON field to structs, which stores the raw JSON message passed in UnmarshalJSON. If rawJSON isn't blank, MarshalJSON returns this value directly; otherwise, the object is marshaled normally.

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 this pull request may close these issues.

1 participant