forked from platypush/platypush
Propagate the default/required properties of a parameter upon merge.
This commit is contained in:
parent
1732bfa82c
commit
9e489bb5cf
1 changed files with 10 additions and 0 deletions
|
@ -79,6 +79,16 @@ class IntegrationMetadata:
|
||||||
if param.doc and not params[param_name].doc:
|
if param.doc and not params[param_name].doc:
|
||||||
params[param_name].doc = param.doc
|
params[param_name].doc = param.doc
|
||||||
|
|
||||||
|
# If the new parameter has required=False,
|
||||||
|
# then that should also be the value for the current ones
|
||||||
|
if param.required is False:
|
||||||
|
params[param_name].required = False
|
||||||
|
|
||||||
|
# If the new parameter has a default value, and the current
|
||||||
|
# one doesn't, then the default value should be set as the new one.
|
||||||
|
if param.default is not None and params[param_name].default is None:
|
||||||
|
params[param_name].default = param.default
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _merge_actions(cls, actions: Dict[str, Action], new_actions: Dict[str, Action]):
|
def _merge_actions(cls, actions: Dict[str, Action], new_actions: Dict[str, Action]):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue