Hi, I would like to clarify why we are trying to generate swagger from code. As i know these APIs first designed with swagger and later implemented java code. If we carefully go through their spec then defining a default value for a attribute and marking that as required is somewhat of a contradiction. If the attribute is required, it will always be sent and the default value will never take effect.
Thanks, sanjeewa. On Thu, Oct 27, 2016 at 1:30 PM, Shavindri Dissanayake <[email protected]> wrote: > Hi, > > There are some instances where the description provided in the code base > does not appear in the swagger UI as mentioned in the example below. Does > anyone know why this might happen? > > Example: > > The annotations 'value' is added to describe the field but this is not > shown in the swagger UI (there were a few other instances like that.) > > Note: I have note marked id as a required field, yet it takes it as true > by default. But the default value for this should be false. Not sure why > this happens. > > > -------------------- Code [1]----------------------- > > @Permission(name = "Enroll Device", permission = > "/device-mgt/devices/enroll/android") > Response isEnrolled( > @ApiParam( > name = "id", > value = "The unique device identifier") > @PathParam("id") String id, > @ApiParam( > name = "If-Modified-Since", > value = "Checks if the requested variant was modified, since > the specified date-time.\n" + > "Provide the value in the following format: EEE, d > MMM yyyy HH:mm:ss Z.\n" + > "Example: Mon, 05 Jan 2014 15:10:00 +0200", > required = false) > @HeaderParam("If-Modified-Since") String ifModifiedSince); > > ---------------------Swagger UI---------------------------- > > > [1] > https://github.com/wso2/carbon-device-mgt-plugins/blob/master/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java > > Thanks & Regards > Shavindri Dissanayake > Technical Writer > > WSO2 Inc. > lean.enterprise.middleware > -- *Sanjeewa Malalgoda* WSO2 Inc. Mobile : +94713068779 <http://sanjeewamalalgoda.blogspot.com/>blog :http://sanjeewamalalgoda.blogspot.com/ <http://sanjeewamalalgoda.blogspot.com/>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
