kerhub/issue-forms-creator

[Bug]: checkboxes with required field are no longer valid

lrstanley opened this issue · 1 comments

Description

When generating a section with the checkboxes type, and selecting required: true, it will generate YAML that no longer correctly matches the Github issue-forms syntax.

Minimal Reproduction

  1. Go to https://issue-forms-creator.app/new
  2. Create a checkboxes type
  3. Create a new checkbox, and make that checkbox required: true.
  4. Generate YAML, and try and use within Github.
  5. You should receive an error stating that the YAML is not valid.

This is what gets generated, as an example:

[...]
  - type: checkboxes
    id: requirements
    attributes:
      label: Requirements
      description: "Please confirm the following:"
      options:
        - label: >-
            I have confirmed that someone else has not submitted a similar
            bug report.
          validations:
            required: true

This is what should be generated:

[...]
  - type: checkboxes
    id: requirements
    attributes:
      label: Requirements
      description: "Please confirm the following:"
      options:
        - label: >-
            I have confirmed that someone else has not submitted a similar
            bug report.
          required: true

Exception or Error

No response

Thanks, it's now fixed!