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

Assert customer marshalling is implemented for resources #1425

Merged
merged 3 commits into from
May 14, 2024

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented May 8, 2024

Changes

This PR ensures every resource implements a custom marshaller / unmarshaller. This is required because we directly embed Go SDK structs. which implement custom marshalling overrides. Since the struct is embedded, the customer marshalling overrides are promoted to the top level. If the embedded struct itself is nil, then JSON marshal / unmarshal will panic because it tries to call MarshalJSON / UnmarshalJSON on a nil object.

Fixing this issue at the Go SDK level does not seem possible. Discussed with @hectorcast-db.

Copy link
Contributor

@hectorcast-db hectorcast-db left a comment

Choose a reason for hiding this comment

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

A couple of notes. Otherwise, looks good.

bundle/config/resources_test.go Outdated Show resolved Hide resolved
bundle/config/resources_test.go Show resolved Hide resolved
@shreyas-goenka shreyas-goenka added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit 6361725 May 14, 2024
5 checks passed
@shreyas-goenka shreyas-goenka deleted the add-test-for-marshaller branch May 14, 2024 10:38
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.

None yet

2 participants