javascript - Swagger 'GET' request always returns as text/html Accept type on response and NOT application/json -


i have swagger tag document using swagger ui returns text/html should return application/json. post requests , every other type returns application/json particular request not. service end point code correct. , if change request post return application/json. type within swagger not return correct type. thoughts how correct call within ui use application/json?

this swagger version 2.1.4 downloaded swagger site.

"/bankname": {     "get": {         "summary": "bank name search",         "description": "bank name search, input routing number return bank name",                         "consumes": [                 "application/json"         ],             "produces": [             "application/json"         ],                                          "parameters": [             {                 "in": "query",                                           "name": "routingnumber",                 "description": "input bank routing number",                 "required": true,                    "type": "string",                                        }         ],         "responses": {             "200": {                 "description": "an array",                 "schema": {                     "type": "object",                     "properties": {                         "errorinfo": {                              "$ref": "#/definitions/errorinfo"                                            },                         "bankname": {                             "type": "string",                                                            }                     }                }                                     },             "400": {                 "description": "invalid request input supplied"                                      },                               "500": {                 "description": "general unexpected error"             }                                }     } }   

accept:application/json

accept-encoding:gzip, deflate, sdch

accept-language:en-us,en;q=0.8

cache-control:no-cache

connection:keep-alive

host:localhost:9086

origin:http://localhost:9086

pragma:no-cache

referer:http://localhost:9086/swagger/index.html

here java code spring restful definition:

@requestmapping(value="bankname",     method=requestmethod.get,     produces=mediatype.application_json_value) 


Comments