Propagate the default/required properties of a parameter upon merge.

This commit is contained in:
Fabio Manganiello 2023-09-30 14:57:11 +02:00
parent 1732bfa82c
commit 9e489bb5cf
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -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]):
""" """