java - Update a response object of the end-point -


i generated automatically springmvc api using swagger. want update end-points manually. have folloiwng end-point:

  @apioperation(value = "estimation of ...", notes = "...", response = similarity.class, responsecontainer = "list")   @io.swagger.annotations.apiresponses(value = {      @io.swagger.annotations.apiresponse(code = 200, message = "similarity metrics", response = similarity.class),     @io.swagger.annotations.apiresponse(code = 200, message = "unexpected error", response = similarity.class) })   @requestmapping(value = "/estimatesimilarity",     produces = { "application/json" },     method = requestmethod.get)   public responseentity<hashmap<string,double>> estimatesimilarity(           @apiparam(value = "...", required = true)           @requestparam(value = "term1", required = true) string term,           @apiparam(value = "...", required = true)           @requestparam(value = "terms", required = true) list<string> concepts)       throws notfoundexception {       similarity similarity = new similarity();       hashmap<string,double> result = similarity.getestimates(term1, terms);       return new responseentity<hashmap<string,double>>(httpstatus.ok);   } 

instead of response = similarity.class, want return hashmap<string,double> result. how should update above-given code able return object?

try modifying apioperations response container.

@apioperation(value = "estimation of ...", notes = "...", response = double.class, responsecontainer = "map") 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -