Description
If an element is declared in arguments_specs.yml as a list of dictionaries and has both a default value and options, then the options are assigned to the variable instead of the default value. This results in a change in the variable type (dictionary instead of list) and an incorrect value.
Reproduction steps
- Create a role with e.g. the following meta/argument_specs.yml:
argument_specs:
main:
short_description: Install php packages and modules
options:
php_ver:
type: int
required: true
default: 84
description: "php version without dots"
php_additional_pools:
type: list
elements: dict
required: false
description: "additional php pools"
default: []
options:
name:
type: str
required: true
default: null
description: "pool name"
- Create the defaults using aar-doc:
$ aar-doc rolepath defaults
Current Behavior
The following invalid defaults file is generated:
---
# Automatically generated by aar-doc
# php version without dots
php_ver: 84
# additional php pools
php_additional_pools:
# pool name
name: null
Expected Behavior
aar-doc defaults should create:
---
# Automatically generated by aar-doc
# php version without dots
php_ver: 84
# additional php pools
php_additional_pools: []
Description
If an element is declared in arguments_specs.yml as a list of dictionaries and has both a default value and options, then the options are assigned to the variable instead of the default value. This results in a change in the variable type (dictionary instead of list) and an incorrect value.
Reproduction steps
Current Behavior
The following invalid defaults file is generated:
Expected Behavior
aar-doc defaults should create: