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

Add an ignore annotation #25

Closed
wants to merge 1 commit into from
Closed

Conversation

glennsarti
Copy link

Previously a struct could never contain a public field that could be ignored by the JSONAPI marshalling/unmarshalling. This made it difficult to provide a struct that only serialized part of the fields. Additionally the JSON (and BSON) marshallers support the '-' as an ignore annotation.

This commit adds the "-" annotation and adds tests and docs updates for this new annotation type.

Previously a struct could never contain a public field that could be
ignored by the JSONAPI marshalling/unmarshalling. This made it difficult
to provide a struct that only serialized part of the fields. Additionally
the JSON (and BSON) marshallers support the '-' as an ignore annotation.

This commit adds the "-" annotation and adds tests and docs updates for this
new annotation type.
@glennsarti
Copy link
Author

Hrmmm although, I just noticed, that if don't annotate it all, it's ignored...not sure this PR is needed :-(

@glennsarti glennsarti marked this pull request as draft July 31, 2024 08:38
@brandonc
Copy link
Collaborator

brandonc commented Aug 2, 2024

Yeah, I think omitting the annotation altogether is probably the right move.

@glennsarti glennsarti closed this Aug 4, 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.

2 participants