Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mohannad-musleh opened this issue Oct 21, 2021 · 2 comments

Comments

@mohannad-musleh
Copy link

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

@mrin9
Copy link
Collaborator

mrin9 commented Oct 22, 2021

thanks for the report, will look into it. as a workaround use string values "false" and "0" to fix it at your end

@mohannad-musleh
Copy link
Author

Thank you, will use the workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants