mirror of
https://github.com/langgenius/dify.git
synced 2026-06-16 22:11:09 +08:00
docs(openapi): state the ErrorBody field table in the contract module docstring
This commit is contained in:
parent
32809403d6
commit
50573c78b9
@ -2,10 +2,18 @@
|
||||
|
||||
``ErrorBody`` is the only wire shape an /openapi/v1 endpoint may emit for a
|
||||
non-2xx response (RFC 8628 device-flow responses excepted — that shape is
|
||||
mandated by the OAuth spec). ``OpenApiErrorFormatter`` is injected into
|
||||
``ExternalApi`` so every error-handler path funnels through one builder, and
|
||||
it also rewrites ``e.data`` because flask-restx ``Api.handle_error`` lets a
|
||||
pre-existing ``e.data`` override the registered handler's return value.
|
||||
mandated by the OAuth spec)::
|
||||
|
||||
code str semantic error code (OpenApiErrorCode member)
|
||||
message str human-readable summary
|
||||
status int HTTP status, duplicated in the body
|
||||
hint str | None actionable next step for the caller
|
||||
details list[ErrorDetail] per-field validation breakdown {type, loc, msg}
|
||||
|
||||
``OpenApiErrorFormatter`` is injected into ``ExternalApi`` so every
|
||||
error-handler path funnels through one builder, and it also rewrites
|
||||
``e.data`` because flask-restx ``Api.handle_error`` lets a pre-existing
|
||||
``e.data`` override the registered handler's return value.
|
||||
"""
|
||||
|
||||
from enum import StrEnum
|
||||
|
||||
Loading…
Reference in New Issue
Block a user