Swagger UI shows raw html in Response Body frame

631 views
Skip to first unread message

Dan

unread,
Nov 12, 2015, 11:17:03 AM11/12/15
to Swagger
Hi All,

I use swagger with Lavarel. When the response is html, the raw html just showed in the response body frame, but not the rendered web page.
I used to use swagger with ruby grape, it could render the html.

I'm not sure if it has something to do with https://github.com/slampenny/Swaggervel
But I think the swagger community should be more good at this.
Could anyone please hint me, any help will be highly appreciated.

This is my swagger

{
    "swagger": "2.0",
    "info": {
        "version": "1.0.0"
    },
    "basePath": "",
    "consumes": [
        "application/json"
    ],
    "produces": [
        "text/html"
    ],
    "paths": {
        "/api/order/create": {
            "post": {
                "tags": [
                    "Order"
                ],
                "produces": [
                    "text/html"
                ],
                "parameters": [
                    {
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/orderInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "An example resource"
                    }
                }
            }
        },
        "/": {
            "get": {
                "tags": [
                    "Root"
                ],
                "produces": [
                    "text/html"
                ],
                "responses": {
                    "200": {
                        "description": "An example resource"
                    }
                }
            }
        }
    },
    "definitions": {
        "errorModel": {
            "required": [
                "code",
                "message"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "format": "int32"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "order": {
            "required": [
                "id",
                "name"
            ],
            "properties": {
                "id": {
                    "type": "integer",
                    "format": "int64"
                },
                "name": {
                    "type": "string"
                }
            }
        }
    }
}


Reply all
Reply to author
Forward
0 new messages