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

Serialize default values in oneofs when calling to_dict() or to_json() #110

Merged
merged 12 commits into from
Jul 25, 2020
Merged

Serialize default values in oneofs when calling to_dict() or to_json() #110

merged 12 commits into from
Jul 25, 2020

Commits on Jul 8, 2020

  1. Serialize default values in oneofs when calling to_dict() or to_json()

    This change is consistent with the official protobuf implementation. If
    a default value is set when using a oneof, and then a message is
    translated from message -> JSON -> message, the default value is kept in
    tact. Also, if no default value is set, they remain null.
    bradykieffer committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    265c075 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d9eab6d View commit details
    Browse the repository at this point in the history
  3. Cleanup oneof_enum test cases, they should be fixed

    This _should_ address:
    #63
    bradykieffer committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    4fc2f71 View commit details
    Browse the repository at this point in the history
  4. Include default value oneof fields when serializing to bytes

    This will cause oneof fields with default values to explicitly be sent
    to clients. Note that does not mean that all fields are serialized and
    sent to clients, just those that _could_ be null and are not.
    bradykieffer committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    68d58b3 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2020

  1. Remove assignment when populating a sub-message within a proto

    Also, move setattr out one indentation level
    bradykieffer committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    72f9686 View commit details
    Browse the repository at this point in the history
  2. Properly transform proto with empty string in oneof to bytes

    Also, updated tests to ensure that which_one_of picks up the set field
    bradykieffer committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    4252a10 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0726f7f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4789636 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f904b5c View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2020

  1. Configuration menu
    Copy the full SHA
    2e86a44 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8d3fa9e View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2020

  1. Merge branch 'master' of github.com:danielgtaylor/python-betterproto …

    …into brady/fix-default-values-oneof-serialization
    bradykieffer committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    b520064 View commit details
    Browse the repository at this point in the history