2

I am using spring boot with swagger for REST API services. The swagger returns the response in the following format when exception occurs

    {
  "timestamp": 1449742584285,
  "status": 500,
  "error": "Internal Server Error",
  "exception": "com.foo.exception.NotFoundException",
  "message": "User with id 1 not found",
  "path": "/user/1"
}

Instead of returning the detailed response I want to show only the message. Also all the time the server tkhrows an RuntimeException.

How to achieve swagger to retun only the message.

Xstian
  • 8,184
  • 10
  • 42
  • 72
Achaius
  • 5,904
  • 21
  • 65
  • 122
  • Are you saying this is what your Swagger documentation is is displaying? Swagger should have nothing to do with the error being returned – Leon Dec 10 '15 at 11:13
  • I want to configure the swagger response. I am expecting only message as response by excluding timestamp, error, exception and path information – Achaius Dec 10 '15 at 11:14
  • @Leon Any suggestions.. – Achaius Dec 10 '15 at 11:28

0 Answers0