swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

allowEmptyValue not implemented?

Open rick22sun opened this issue 10 years ago • 1 comments

Looks like allowEmptyValue not implemented. The goal is to produce a query parameter ?param1 without any value and the '=' sign. Tried the following

{
        in: "query",
        name: "param1",
        type: "string",
        required: false,
        allowEmptyValue : true
}

with different type, but can't send ?param1 in the URL. The closest I can get is ?param1=true using:

{
        in: "query",
        name: "param1",
        type: "string",
        required: false,
        enum : ["true"]
}

Ideally, if allowEmptyValue = true, then ui presents a checkbox: when checked send ?param1, else just do not include the parameter.

rick22sun avatar Jan 29 '16 21:01 rick22sun

Same here, very useful to implement reset logic for values, otherwise it can't be implemented.

For case:

required: false,
allowEmptyValue : true

need to draw checkbox. If you check it - the swagger ui will send ?param1 or ?param1=, otherwise there no be parameter in request.

Is there any progress on this?

Hronom avatar Jul 19 '18 10:07 Hronom