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

feat: update go sdk generated code with strict decoder disabled #50

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

drohit-cb
Copy link
Contributor

@drohit-cb drohit-cb commented Feb 6, 2025

What changed? Why?

With some recent CDP API backend changes, it was observed that adding new fields to api responses seems to break the go client and returns error of typically this format.

APIError{Code: unknown, Message: json: unknown field "pending_claimable_balance"}

This happens even when fields are marked optional.

This error can be attributed to strict json decoding that the client applies by default. Example code here.

This PR helps regenerate the go auto-generate client with this setting disallowAdditionalPropertiesIfNotPresent set to false. This helps remove this strict decoder check. Config option description can be found here and a github issue discussing this issue.

Testing

Verified running example scripts examples/ethereum/dedicated-eth-stake/main.go and examples/ethereum/shared-eth-stake/main.go

Qualified Impact

@cb-heimdall
Copy link

cb-heimdall commented Feb 6, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@drohit-cb drohit-cb force-pushed the feat/disable-strict-decoder branch 2 times, most recently from d452a10 to 17a79fe Compare February 7, 2025 16:20
@drohit-cb drohit-cb marked this pull request as ready for review February 7, 2025 16:30
@drohit-cb drohit-cb force-pushed the feat/disable-strict-decoder branch from 17a79fe to 1bcec05 Compare February 7, 2025 16:32
@drohit-cb drohit-cb requested a review from djoyahoy February 7, 2025 16:32
@drohit-cb drohit-cb merged commit db0c437 into master Feb 7, 2025
5 checks passed
@drohit-cb drohit-cb deleted the feat/disable-strict-decoder branch February 7, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants