Skip to content

Help to accept empty block or block with only valid list entries #276

@rfuehrer

Description

@rfuehrer

I would like to check a user-maintained YAML in which a "subscription" block can be included. This should contain list entries. If this block exists, but is specified without subitems/list elements, it should be accepted. If a list element is specified, it must exist as a string.

Permitted:

before:
   - ok1
   - ok2

subscription:

after:
  - ok1
  - ok2

or

before:
   - ok1
   - ok2

subscription:
  - test1
  - test2

after:
  - ok1
  - ok2

Not allowed:

before:
   - ok1
   - ok2

subscription:
  -

after:
  - ok1
  - ok2

Can this be implemented with Yamale?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions