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 encoding option to specify how omitempty fields are encoded #453

Merged
merged 2 commits into from
Jan 7, 2024

Commits on Dec 19, 2023

  1. Add encoding option to specify how omitempty fields are encoded

    The current behavior in the library is to omits if field value
    would encode as empty JSON value. This behavior is different from
    the bahavior in golang encoding/json which omits if field value
    is an empty Go value (defined as false, 0, a nil pointer, a nil
    interface value, and any empty array, slice, map, or string).
    The OmitEmptyMode = 1 is added to encoding option so that cbor
    would decode omitempty fields similarly to encoding/json in go.
    
    Signed-off-by: Vu Dinh <vudinh@outlook.com>
    dinhxuanvu committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    0d142f9 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Address feedbacks

    Signed-off-by: Vu Dinh <vudinh@outlook.com>
    dinhxuanvu committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    f95914b View commit details
    Browse the repository at this point in the history