mirror of
https://github.com/langgenius/dify.git
synced 2026-07-15 01:17:04 +08:00
Finish unifying request validation so every validation failure on the openapi surface (except the excluded OAuth device-flow) returns 422: - migrate workspace member invite (POST) and role update (PUT) and the human-input form submit (POST) onto @accepts(body=); drop the local _validate_body helper. human-input previously ran a bare model_validate with no handler, so a malformed body surfaced as 500 — now a clean 422. Service-layer domain errors keep their intentional 400s. - harden @returns to pass (model, status, headers) tuples through verbatim instead of assuming a 2-tuple. - stop test_contract from leaking test-only models into the shared openapi_ns, and assert the contract decorators' Swagger metadata (params/expect/responses) survives the guard wrapper stack. Spec-neutral: the migrated handlers already advertised the same expect models, so the generated swagger/markdown/contracts are unchanged.