Files
dify/api/controllers/openapi
L1nSn0w 1af89d7fd2 feat(openapi): add @accepts/@returns request-contract decorators
Introduce two decorators in controllers/openapi/_contract.py that each own one
slice of the HTTP contract from a single Pydantic model reference:

- @accepts(query=, body=): validate the request, inject the validated model as a
  typed kwarg, and emit the Swagger param/body schema. Validation errors map to
  422 with ValidationError.json() (one shape).
- @returns(status, model): emit the response schema and serialize the handler's
  returned model via model_dump(mode="json"); non-model returns pass through.

Both sit below @auth_router.guard so auth precedes validation and the unit-test
__wrapped__ seam keeps unwrapping exactly the guard layer.
2026-06-10 10:04:43 +08:00
..
2026-05-26 01:12:36 +00:00
2026-05-26 01:12:36 +00:00