Uploaded image for project: 'Opencast'
  1. MH-13416

REST docs defaultValue not correctly set for boolean parameters

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects versions: 6.2
    • Fix versions: 7.0
    • Components: Backend Software
    • Labels:
      None
    • Severity:
      Incorrectly Functioning With Workaround
    • Steps to reproduce:
      Hide
      During the review of https://github.com/opencast/opencast/pull/642, we found that the defaultValue is not handled correctly by the dynamically generated REST docs:

      @RestParameter(name = "override", defaultValue = "false", isRequired = false, description = "If true the series ACL will take precedence over any existing episode ACL", type = BOOLEAN)

      will result in the Checkbox being selected by default in the REST docs.

      Workaround: Omit defaultValue

      This is an error in the default REST docs template template.xhtml found in common/src/main/resources/ui/restdocs/template.xhtml:

        <td>
                        <input id="${endpoint.name}-${endpoint?counter}_${item.name}"
                               name="${item.name}"
                               class="form_field <#if item.path>form_param_path<#else>form_param_submit</#if><#if item.required> form_param_required</#if>"
                               type="checkbox"
                               value="true" <#if item.defaultValue??>checked="${item.defaultValue}" defaultChecked="${item.defaultValue}"</#if> />
                      </td>
      Show
      During the review of https://github.com/opencast/opencast/pull/642, we found that the defaultValue is not handled correctly by the dynamically generated REST docs: @RestParameter(name = "override", defaultValue = "false", isRequired = false, description = "If true the series ACL will take precedence over any existing episode ACL", type = BOOLEAN) will result in the Checkbox being selected by default in the REST docs. Workaround: Omit defaultValue This is an error in the default REST docs template template.xhtml found in common/src/main/resources/ui/restdocs/template.xhtml:   <td>                   <input id="${endpoint.name}-${endpoint?counter}_${item.name}"                          name="${item.name}"                          class="form_field <#if item.path>form_param_path<#else>form_param_submit</#if><#if item.required> form_param_required</#if>"                          type="checkbox"                          value="true" <#if item.defaultValue??>checked="${item.defaultValue}" defaultChecked="${item.defaultValue}"</#if> />                 </td>

      TestRail: Results

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              staubesv Sven Stauber
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                TestRail: Cases