Official doc: Validators - Pydantic
Another way using
AfterValidator
(more)Each endpoint in
/docs
displays a schema that defines its responses and inputs. This section explains how to customize these schemas.- Another way for custom response with error code
- This doc is useful too.
Ví dụ để hiển thị được giống vầy khi nhấn “Try it out”