Open
Description
Rule. A field with (pxf.required) or @required holds a value. A decoder rejects it when it is absent and also when it is bound to null, whatever the field's type and presence. Decided by the owner on 2026-11-04, reversing protowire#339 option 3 on this one point. Spec: trendvidia/protowire#569. Reference: trendvidia/protowire-go#268.
Measured on main (c685ff0) with the spec's nulls fixtures plus controls:
- Full tier (
check-decode --format pxf-pb):r = nullonoptional int32 r [(pxf.required) = true]is accepted, and so isw = nullon a requiredInt32Value. Both must be rejected. The controls behave (absentrrejected,r = 0accepted). - Lite tier (
RequiredPxfCodec.unmarshal, throwaway test inlite-fixtures):r = nullis accepted. The lite fixtures have noRequiredWrapper, so the wrapper case was not run. - The generated
NULLABLE_FIELDStable also changes: protowire#569 makesprotoc-gen-pxf-java-metaleave required fields out of it.
Done when
- Both tiers reject
nullon a required field in a body, a nested body and a@datasetcell, naming the field (the spec assertsnull is not allowed on required field "<name>"). - The vendored corpus picks up protowire#569's fixtures once it merges.
Metadata
Metadata
Assignees
Labels
No labels
Activity
bfrancojr commentedon Nov 5, 2026
One more place this lands:
LiteTablesTestrunsnullFixtureIsAccepted("required-optional.pxf"). Built against aprotoc-gen-pxf-java-metafrom current protowire main, which drops required fields fromNULLABLE_FIELDS(protowire#569), it fails with1:5: null is not allowed on field "r": it has no unset state, or it is required. With the pinned plugin it passes. So the nextpxfJavaMeta.refbump breaks it unless this issue's fix lands first. The fixture iserr-required-optional.pxfin the corpus now, so that test case should become a reject. Measured on main and on PR #192 with the same result, so it is not caused by #192.