Skip to content

Commit

Permalink
Allow author, top-level description, and todo to be a string instead …
Browse files Browse the repository at this point in the history
…of a list of strings.
  • Loading branch information
felixfontein committed Dec 14, 2023
1 parent 8305647 commit 2458b55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/227-role-argspec-str-to-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "For role argument specs, allow ``author``, ``description``, and ``todo`` to be a string instead of a list of strings, similarly as with ansible-doc and with modules and plugins (https://github.com/ansible-community/antsibull-docs/pull/227)."
11 changes: 11 additions & 0 deletions src/antsibull_docs/schemas/docs/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
SeeAlsoLinkSchema,
SeeAlsoModSchema,
SeeAlsoRefSchema,
list_from_scalars,
)

_SENTINEL = object()
Expand Down Expand Up @@ -69,6 +70,16 @@ class RoleEntrypointSchema(BaseModel):

options: dict[str, RoleOptionsSchema] = {}

@p.validator(
"author",
"description",
"todo",
pre=True,
)
# pylint:disable=no-self-argument
def list_from_scalars(cls, obj):
return list_from_scalars(obj)


class RoleSchema(BaseModel):
"""Documentation for roles."""
Expand Down

0 comments on commit 2458b55

Please sign in to comment.