Skip to content

Query parameters default value is not rendered if the value is 0 or false #591

@mohannad-musleh

Description

@mohannad-musleh

When the schema includes query parameters with default value = 0 (type: integer) or false (type: boolean), the default value is not shown in the rendered document.

Setup details:

Example:

Schema
{
    "components": {},
    "info": {
        "title": "Example Schema",
        "version": "0.0.1"
    },
    "openapi": "3.0.3",
    "paths": {
        "/api/v1/example": {
            "get": {
                "operationId": "v1_example",
                "description": "Example API",
                "parameters": [
                    {
                        "in": "query",
                        "name": "boolean_query_parameter",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    },
                    {
                        "in": "query",
                        "name": "integer_query_parameter",
                        "schema": {
                            "type": "integer",
                            "default": 0
                        }
                    }
                ]
            }
        }
    }
}
Screenshot

Screen Shot 2021-10-21 at 2 28 06 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions