We're updating the issue view to help you get more done. 

REST docs defaultValue not correctly set for boolean parameters

Steps to reproduce

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>

Status

Assignee

Unassigned

Reporter

Sven Stauber

Severity

Incorrectly Functioning With Workaround

Tags (folksonomy)

None

Components

Fix versions

Affects versions

6.2

Priority

Minor