Swagger: How to handle a response containing a java 'object' class -
i trying understand how specify in "swagger" response object of class "viewobject.java"
contains object of class "object" in example below contains instance of "app.java"
. in below code when specify @apioperation
"response = viewobject.class"
cannot figure out in viewobject "result" field contains instance of "app".
@get @path("/app/{appcode}") @produces("application/json") @apioperation(value = "get app configuration", response = viewobject.class) public @responsebody viewobject getapp(@pathparam("appcode") string appcode) throws freemoexception,exception { app app = new app(); app.setappcode(appcode); viewobject viewobject = new viewobject(); app apploadedfromdb = appservice.getapp(app.getappcode()); //load app db viewobject.setstatus(freemostatus.success); viewobject.setresult(apploadedfromdb); return viewobject; }
viewobject.java: public class viewobject extends freemomodel{ private freemostatus status; private string message; private object result; }
Comments
Post a Comment