Files
zeekayandHanzo Dev 6168c092c9 jsonschema: emit properties:{} again — value receiver + no omitempty
MarshalJSON had drifted to a pointer receiver while Properties gained
`,omitempty`. Together those defeated the nil->empty-map fill: encoding/json
never invokes a pointer-receiver MarshalJSON on non-addressable values (map
entries, a Definition passed by value), and omitempty drops the empty map even
when it does. Nested schemas therefore lost the "properties":{} that OpenAI
requires on object schemas — the exact bug #419/#434 fixed.

Value receiver restores the guarantee for map entries and by-value marshals;
dropping omitempty lets the filled empty map through. TestDefinition_MarshalJSON
(got and gotPtr) passes again.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 15:43:22 -07:00
..