protocolbuffers / protocolbuffers/protobuf
FieldMask in ProtoJSON fails to parse from "null"
Open
@esrauchg is already working on this.
Since Dec 23, 2025.
keep open
- Dominant language
- C++
- Stars
- 72k
- Forks
- 16.3k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 140
Description
Hello! It looks like null-JSON (i.e. simply top-level "null") is not accepted by FieldMask parsing code https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/json/internal/parser.cc#L1001
This differs from other "well-known" types, for example, Timestamp/Duration, which accept null-JSON as a valid value and simply leave message default-initialized: https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/json/internal/parser.cc#L949 .
Can u please explain - is it intentional (and why)?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.