Yeah..I am specifying 201 under @ApiResponses. But for some reason, 200 also gets added by default. I believe that in springfox swagger, there is a flag to set "usedefaultResponseMessages" to false. If that is done, 200 does not show up in swagger page. Is there a similar flag in cxf-swagger so that I can make use of it.
Thanks, Aishwarya S On Thu, 18 Oct 2018, 4:01 am Andriy Redko, <[email protected]> wrote: > Hi Aishwarya, > > Sounds great, thank you. Regarding 201, AFAIK this is a Swagger > limitation, I remember fighting it back in the days. > You need to specify the right code on @ApiOperation level, f.e.: > > @ApiOperation( > value = "Create new user record", > code = 201, > consumes = "application/json", > produces = "application/json", > ... > ) > > Hope it helps :-) > Thanks! > > Best Regards, > Andriy Redko > > asgc> Sure, will contribute to this feature when I find time. But I am not > a registered member of apache.org. > > asgc> I have one more question. Is it possible to customize Response Codes > in cxf-Swagger? I mean for example, for a > asgc> POST request, the response code in my case should be 201(CREATED). I > am able to add it using @ApiResponses, but it > asgc> seems Swagger uses 200 as a default response code for all APIs.I > don't wanna use default response codes. > asgc> Is it possible to set a flag somewhere saying > "useDefaultResponseCodes" to false. > > asgc> Thanks, > asgc> Aishwarya S > > > asgc> On 2018/09/29 00:06:34, Andriy Redko <[email protected]> wrote: > >> Hi Aishwarya, > > > >> I have just received the update from our guys, you can see comments > here https://issues.apache.org/jira/browse/CXF-6757, > >> to conclude the work has not been started in this direction, only good > ideas. We may not have time to work on it > >> right now, but it is certainly included into backlog. If you feel like > contributing this feature, it would be very > >> welcomed. Thank you. > > >> Best Regards, > >> Andriy Redko > > > >> asgc> Hi Andriy, > > >> asgc> Okay. Any idea on how long it will take to enable customizations. > If its gonna take a lot of time and effort, we > >> asgc> will think of alternative approaches. Else we'll wait for the > release. > > > > > > >
