Skip to content

Commit

Permalink
handle anyOf, allOf, oneOf in top level
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Jan 8, 2025
1 parent 51fba5a commit 2f2950f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nf_core/pipelines/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,16 @@ def validate_default_params(self):
schema_no_required = copy.deepcopy(self.schema)
if "required" in schema_no_required:
schema_no_required.pop("required")
for keyword in ["allOf", "anyOf", "oneOf"]:
if keyword in schema_no_required:
for i, kw_content in enumerate(schema_no_required[keyword]):
if "required" in kw_content:
schema_no_required[keyword][i].pop("required")
schema_no_required[keyword] = [
kw_content for kw_content in schema_no_required[keyword] if kw_content
]
if not schema_no_required[keyword]:
schema_no_required.pop(keyword)
for group_key, group in schema_no_required.get(self.defs_notation, {}).items():
if "required" in group:
schema_no_required[self.defs_notation][group_key].pop("required")
Expand Down

0 comments on commit 2f2950f

Please sign in to comment.