You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Refactor/Chore] Add console namespace helpers for schema decorators #43835
I confirm that I am using English to submit this report, otherwise it will be closed.
【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
Please do not modify this template :) and fill in all the required fields.
Description
The console controllers spell out two decorators by hand: @console_ns.expect(console_ns.models[Payload.__name__]) at 279 sites and @console_ns.doc(params=query_params_from_model(Query)) at 126 sites. Proposal: give console_ns a small Namespace subclass with expect_model(Payload) and doc_query(Query) helpers that do the same lookup and call at import time.
Motivation
Each decorator becomes one short call, and the 49 controller files that import query_params_from_model only for these decorators no longer need it. Behavior stays the same: an unregistered model still raises KeyError, and the generated OpenAPI specs do not change.
Activity