Documentation
¶
Overview ¶
Command uniquegen emits unique_items.json: per message, the JSON field names of every repeated field declaring (buf.validate.field).repeated.unique — i.e. the fields whose items are a SET on the wire, where Go protovalidate rejects a duplicate.
It exists because that rule reaches neither generated client on its own: protoschema-plugins emits no `uniqueItems` keyword at all, so the constraint is absent from the JSON Schema the Pydantic/Zod pipeline consumes. merge_schema.py reads this manifest and injects `uniqueItems: true` (json-schema-to-zod turns that into a `.refine(...)`), and scripts/sdk-types/gen_unique_py.py reads the SAME manifest to emit gen/python/wire/unique.py, which the hand-written wire/base.py seam enforces — datamodel-code-generator drops `uniqueItems` for Pydantic v2.
Like requiredgen, this is a Go program because Go protovalidate is the authoritative view of the rules (the same engine the conformance corpus is labeled against), and the Python bridge must not re-implement rule semantics. Scope comes from conformance.Contract.