mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
fix(web): use generated account-profile contracts (#36927)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
3cd0da303a
commit
dea4e66456
34 files changed
+268
-151
No files matched your search
@@ -140,3 +140,23 @@ def test_service_document_list_documents_query_params_render(monkeypatch: pytest
|
||||
|
||||
for name in ("page", "limit", "keyword", "status"):
|
||||
assert params[name]["in"] == "query"
|
||||
|
||||
|
||||
def test_console_account_avatar_query_param_renders_as_query(monkeypatch: pytest.MonkeyPatch):
|
||||
from configs import dify_config
|
||||
from controllers.console import bp as console_bp
|
||||
|
||||
monkeypatch.setattr(dify_config, "SWAGGER_UI_ENABLED", True)
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config["TESTING"] = True
|
||||
app.config["RESTX_INCLUDE_ALL_MODELS"] = True
|
||||
app.register_blueprint(console_bp)
|
||||
|
||||
payload = app.test_client().get("/console/api/swagger.json").get_json()
|
||||
operation = payload["paths"]["/account/avatar"]["get"]
|
||||
params = _parameters_by_name(operation)
|
||||
|
||||
assert "payload" not in params
|
||||
assert params["avatar"]["in"] == "query"
|
||||
assert params["avatar"]["required"] is True
|
||||
Reference in new issue
Block a user