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

fix: Correctly marshal/unmarshal custom types when null/unknown #750

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

amstuta
Copy link
Collaborator

@amstuta amstuta commented Oct 14, 2024

Description

Correctly handle Marshalling/Unmarshalling of custom types when they hold a null or unknown value.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran succesfully go mod vendor if I added or modify go.mod file

mxpetit
mxpetit previously approved these changes Oct 14, 2024
ovh/types/map.go Outdated
return []byte("null"), nil
}

toMarshal := make(map[string]T)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
toMarshal := make(map[string]T)
toMarshal := make(map[string]T, len(t.Elements()))

@amstuta amstuta force-pushed the dev/aamstutz/fix-null-parsing branch from 03054c9 to f717e59 Compare October 14, 2024 09:55
@amstuta amstuta merged commit cc4b079 into master Oct 14, 2024
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.

3 participants