Skip to content

"Try it out" doesn't prompt with form when parameters are a schema #2771

Open
@andrew-regan

Description

@andrew-regan

The following path used to provide username/password text input fields. In 3.0.2 it now requires the "Example Value" text box to be edited. It looks like this happens when the input parameters are specified using schema.

        "/auth/token": {
            "post": {
                "tags": [
                    "auth"
                ],
                "summary": "Get an API key",
                "description": "",
                "operationId": "getApiKey",
                "security": [],
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json; version=1.0"
                ],
                "parameters": [
                    {
                        "in": "body",
                        "name": "body",
                        "description": "Authentication",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/auth_credentials"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Authentication",
                        "schema": {
                            "description": "Authorization Result",
                            "allOf": [
                                {
                                    "$ref": "#/definitions/Response"
                                },
                                {
                                    "properties": {
                                        "result": {
                                            "description": "API Key",
                                            "type": "string",
                                            "example": "example_api-key_iZkjs8-Yc2LzRjpwKbai11kkPZg"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid Format",
                        "schema": {
                            "$ref": "#/definitions/ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Invalid Credentials",
                        "schema": {
                            "$ref": "#/definitions/AuthErrorResponse"
                        }
                    }
                }
            }
        }
...
        "auth_credentials": {
            "type": "object",
            "properties": {
                "username": {
                    "type": "string",
                    "minLength": 1,
                    "title": "Username"
                },
                "password": {
                    "type": "string",
                    "format": "password",
                    "minLength": 1,
                    "title": "Password",
                    "secret": true
                }
            },
            "additionalProperties": false,
            "required": [
                "username",
                "password"
            ]
        },

screen shot 2017-03-22 at 1 03 41 pm

As an example the following path which does not use schema provides a text input field for name:

        "/support_bundles/{name}": {
            "delete": {
                "tags": [
                    "support_bundles"
                ],
                "summary": "Delete a single support bundle",
                "description": "",
                "operationId": "deleteSupportBundle",
                "produces": [
                    "application/json; version=1.0"
                ],
                "parameters": [
                    {
                        "name": "name",
                        "in": "path",
                        "description": "Name of support bundle",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "schema": {
                            "$ref": "#/definitions/Response"
                        }
                    }
                }
            }
        },

screen shot 2017-03-22 at 1 07 17 pm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions