Skip to content

protobuf.js decode object missing some field when the field have default value #521

Closed
@dbskccc

Description

@dbskccc

with protobuf 6, all field with default value will not encode to serialized data, but when protobuf.js decode it, the generated object also not have such field, since we don't know which field will have default value,
we have to check every field for undefined and assign a default value to further process(display,calculate), it's somewhat annoying, it should be an parameter on decode function to guide protobuf.js to fill the default field value.

test with protobuf.js 6.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions