Context
Split from #379 (was "item B"). This is defensive hardening, not a live regression — schemas always arrive as pure JSON from Pydantic model_json_schema(), so the anonymous-hash path is not reached with non-JSON input in practice. Tracked separately so it does not dilute the JSON-Pointer-safety fix in #379.
_schema_short_hash() (utils.py:144) uses default=str:
canonical = json.dumps(schema, sort_keys=True, default=str)
default=str silently stringifies non-JSON objects. str(obj) may embed a memory address, making InlineSchema_<hash> differ across processes — contradicting the "stable/deterministic hash" docstring — and it masks a violation of the endpoint-metadata contract (schemas must be plain JSON-compatible dicts).
Acceptance Checklist
Out of scope
References
Context
Split from #379 (was "item B"). This is defensive hardening, not a live regression — schemas always arrive as pure JSON from Pydantic
model_json_schema(), so the anonymous-hash path is not reached with non-JSON input in practice. Tracked separately so it does not dilute the JSON-Pointer-safety fix in #379._schema_short_hash()(utils.py:144) usesdefault=str:default=strsilently stringifies non-JSON objects.str(obj)may embed a memory address, makingInlineSchema_<hash>differ across processes — contradicting the "stable/deterministic hash" docstring — and it masks a violation of the endpoint-metadata contract (schemas must be plain JSON-compatible dicts).Acceptance Checklist
default=strwith strict serialization:json.dumps(schema, sort_keys=True, separators=(",", ":"))so non-JSON input raisesTypeErrorloudly instead of producing a non-deterministic name.TypeError; identical schemas hash identically.Out of scope
References
src/azure_functions_openapi/utils.py:142-145