Could not resolve reference because of: Could not resolve pointer: /definitions/Error does not exist in document
I followed this link http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api , but getting above error while I add globalResponseMessage() methhod for custom response message.I can't understand what's the reason. Please help....TIA
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.apiInfo(apiInfo())
.consumes(getContentType())
.produces(getContentType())
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET, newArrayList(
new ResponseMessageBuilder()
.code(500).message("500 message")
.responseModel(new ModelRef("Error")).build(),
new ResponseMessageBuilder()
.code(403)
.message("Forbidden!!!!!")
.build()));
}