Skip to content

Draft: Demo permissive serialization model for Go SDK #48

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

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

fernjaleel
Copy link

@fernjaleel fernjaleel commented Jul 16, 2025

This PR demonstrates the different serialization options outlined in this document:

https://www.notion.so/buildwithfern/Golang-Permissive-Deserialization-232b23082e4c80d0b47bd288fb28fd5d

With some simple test cases for demonstrating failure modes and expected outputs of each option. At the time of writing invalid deserialization is only demonstrated by the GetPayoutResponse.Payout.ID field

Additionally, it looks like the existing internal.ExtractExtraProperties performs an unnecessary secondary unmarshal in the UnmarshalJSON call path (1, 2). The PR also includes an additional internal.ExtractExtraPropertiesUnmarshalled function to reuse the first unmarshalled object for comparing keys agains the extra properties map

@fernjaleel fernjaleel changed the title initial PR for demonstrating permissive serialization Draft: Demo permissive serialization model for Go SDK Jul 16, 2025
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