ansible-community / antsibull-docs

Tooling for building Ansible documentation
https://ansible.readthedocs.io/projects/antsibull-docs/
GNU General Public License v3.0
22 stars 17 forks source link

Fix bugs in choices #276

Closed felixfontein closed 2 months ago

felixfontein commented 2 months ago

Fixes https://github.com/ansible/ansible/issues/83204.

https://github.com/ansible/ansible/pull/83149/files#diff-fc025deb71887b0e6b0b3280f4dac62412a7e253db3417036dc9ce8d9a9f8e52R24 triggered three bugs in antsibull-docs:

  1. If choices is a dictionary for type=list, it was treated as a single entry in the choices list for validation purposes (resulting in a validation error).
  2. If choices is a dictionary for type=list, the normalized result was recombined incorrectly, resulting in a list with a single entry.
  3. If default is present for type=list with choices, rendering fails with TypeError: unhashable type: 'list'. (This only happens after 1. is fixed.)