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

[Feature] Support disabling rawJSON field in the go SDK #2987

Open
arcurtis opened this issue Feb 15, 2024 · 1 comment
Open

[Feature] Support disabling rawJSON field in the go SDK #2987

arcurtis opened this issue Feb 15, 2024 · 1 comment

Comments

@arcurtis
Copy link

Problem description

There a _rawJSON field in every struct in the go SDK. This is counter to go's standard json unmarshalling where values without a field and json annotation aren't stored. As I understand from @amckinney, this field is meant to preserve the original server response for debugging purposes.

The use of this rawJSON field doubles the size memory used by the structs in all usage, including our customer production environments where memory is a concern. Additionally, this makes writing verifications for tests that use the SDK more difficult because we have to account for the rawJSON field in the expected verification.

Why would it be useful?

This would be useful for go SDKs targeted towards memory-sensitive customers and for writing tests.

Describe the solution (optional)

Implement a generator option (say disableRawJSON) that disables this functionality.

@amckinney
Copy link
Collaborator

This is a totally reasonable feature request. You can actually see the rationale in the PR that introduced the feature in this PR (you'll notice it calls out your concern w.r.t. size too).

We'll follow-up with a disableRawJSON configuration field when we have the capacity to do so!

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

No branches or pull requests

2 participants