I defined a request taking a json object as parameter in the body. The json object contains a number value. If this value is 0, the corresponding json is not included in the request.
The following definition:
swagger: "2.0"
info:
title: title
version: 1.0.0
host: "localhost:8080"
schemes:
- http
produces:
- application/json
paths:
/test:
put:
parameters:
- name: test
in: body
schema:
$ref: "#/definitions/test"
responses:
"200":
description: Success
definitions:
test:
properties:
value:
type: number
Generates the body:
{
"value": 1
}
if value is 1 and
{}
instead of
{
"value": 0
}
if value is 0.
Any update on this?
Should be fixed in 3.X.
Most helpful comment
Any update on this?