requiredgen

command
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Command requiredgen emits required_fields.json: per message, the JSON field names whose proto ZERO value is rejected by the field's own protovalidate rule (an enum not_in:[0], a string min_len≥1 or a pattern that rejects "", a numeric gte≥1, or an explicit required). Those fields are required on the wire but the JSON Schema protoschema emits leaves them optional; merge_schema reads this manifest to mark them `required` (and drop the zero default) so the generated Pydantic/Zod reject omission, matching the Go server.

This is the single, authoritative source of "is the zero value invalid" (the same Go protovalidate the conformance corpus is labeled against), consumed by scripts/gen-sdk-types.sh so the Python bridge does not re-implement the rule semantics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL