mirror of
https://github.com/langgenius/dify.git
synced 2026-07-15 09:27:36 +08:00
Complete the request/response contract unification (GareArc review followup): the remaining handlers that returned a model via manual `.model_dump(mode="json")` now return the bare model behind `@returns`, so every openapi handler references its response model once and doc == runtime. Migrated: version, health, account info/session-revoke (x2), file upload, task stop, human-input form submit, and workspaces list/detail/switch/invite/remove/ role. Handlers returning a bare dict (account info, version, health) now go through `@returns` → `(body, status)`; HTTP behavior is unchanged. Health/task-stop/form-submit now construct their advertised model instead of a hand-built dict.
13 lines
361 B
Python
13 lines
361 B
Python
from flask_restx import Resource
|
|
|
|
from controllers.openapi import openapi_ns
|
|
from controllers.openapi._contract import returns
|
|
from controllers.openapi._models import HealthResponse
|
|
|
|
|
|
@openapi_ns.route("/_health")
|
|
class HealthApi(Resource):
|
|
@returns(200, HealthResponse, description="Health check")
|
|
def get(self):
|
|
return HealthResponse(ok=True)
|