Context
The endpoint metadata namespace (_endpoint.py, shipped via #275 under umbrella #270) currently emits a responses map that contains only the success status (success_status_code -> response object). It does not describe the standardized 422 validation-error response that @validate_http actually returns at runtime ({"detail": [{"loc", "msg", "type"}]}, see pipeline.py:222 and README "Status codes and controlled errors").
As a result, azure-functions-openapi cannot document the 422 contract from the shared namespace, so generated specs omit the error response even though runtime behavior is fixed and well-defined. This is the still-open P1 item "Validation error response schema 반영" from the v0.8 code review.
Note: this supersedes the stale #35, which was closed against the pre-endpoint-namespace design (enable_openapi_integration()), an API that no longer exists.
Target: keep ENDPOINT_METADATA_VERSION at 1 — this is an additive change to the responses map (consumers read defensively with .get()), no schema version bump.
Acceptance Checklist
Out of scope
References
Context
The
endpointmetadata namespace (_endpoint.py, shipped via #275 under umbrella #270) currently emits aresponsesmap that contains only the success status (success_status_code-> response object). It does not describe the standardized422validation-error response that@validate_httpactually returns at runtime ({"detail": [{"loc", "msg", "type"}]}, seepipeline.py:222and README "Status codes and controlled errors").As a result,
azure-functions-openapicannot document the 422 contract from the shared namespace, so generated specs omit the error response even though runtime behavior is fixed and well-defined. This is the still-open P1 item "Validation error response schema 반영" from the v0.8 code review.Note: this supersedes the stale #35, which was closed against the pre-endpoint-namespace design (
enable_openapi_integration()), an API that no longer exists.Target: keep
ENDPOINT_METADATA_VERSIONat 1 — this is an additive change to theresponsesmap (consumers read defensively with.get()), no schema version bump.Acceptance Checklist
build_endpoint_metadataadds a"422"entry toresponseswhenever any request model (body/query/path/headers) is present, using a self-contained JSON Schema for the{"detail": [...]}envelope (no model classes, no$refleakage beyond the SPEC-pinned template).loc,msg,typeitem keys) — cross-checked against the golden tests intest_public_api.py/test_integration.py.schemas/endpoint.schema.json+docs/METADATA_SPEC.mdupdated to document the 422 response shape;endpoint.schema.sha256regenerated.endpointnamespaceresponsescontains both the success status and"422"with the correct schema.make cov);make check-allgreen.Out of scope
azure-functions-openapi(tracked separately in that repo; see feat(metadata): converge cross-package endpoint metadata without new foundation packages #270 checklist).ErrorFormatteroutput schemas — the emitted 422 documents the default envelope only.References
src/azure_functions_validation/_endpoint.py(build_endpoint_metadata,responses)src/azure_functions_validation/pipeline.py:222, README "Status codes and controlled errors"