demessaging.config.api module
DASF API utilties for to access the configuration.
Functions:
|
Configuration decorator for function or modules. |
- demessaging.config.api.configure(js: str | None = None, merge: bool = True, **kwargs) Callable[[T], T] [source]
Configuration decorator for function or modules.
Use this function as a decorator for classes or functions in the backend module like so:
>>> @configure(field_params={"a": {"gt": 0}}, returns={"gt": 0}) ... def sqrt(a: float) -> float: ... import math ... ... return math.sqrt(a)
The available parameters for this function vary depending on what you are decorating. If you are decorating a class, your parameters must be valid for the
ClassConfig
. If you are decorating a function, your parameters must be valid for aFunctionConfig
.- Parameters:
Notes
If you are specifying any
kwargs
, your first argument (js) should beNone
.
- demessaging.config.api.registry = ApiRegistry(imports={}, objects=[])
registry for the stuff that should be available in the generated client stub