Search code examples
swaggerswagger-uiswagger-2.0swagger-editor

Swagger mock mode generating some random data, not returning the one which I have defined in my mock controller


Recently swagger is start behaving very strange. Its not return the actul mock data the one which i have defined in my mock controller. basically its not calling the mock controller at all.

For all the api's its retruning some system generated code some thing like

[
{
"id": "tempor aliquip",
"name": "cillum ea labore ut"
},
{
"id": "esse irure",
"name": "aliqua reprehenderit ut"
},
{
"id": "sunt ex",
"name": "dolor velit"
}
]

Solution

  • Finally I got the answer, And the answer is "if there is extra mapping of end point in the mock controller then swagger automatically start creating end point for you and return any thing random value or system generated value."