cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to remove the default code(200 OK) For POST and DELETE

Highlighted
New Contributor

Is there a way to remove the default code(200 OK) For POST and DELETE

Hi All,

 

Is there a way to remove the default code(200 OK) For POST and DELETE.

I would like to configure swagger API to display "Response Class (Status 201)" instead of "Response Class (Status 200)

 

Thanks!

3 REPLIES 3
Highlighted
Occasional Contributor

Re: Is there a way to remove the default code(200 OK) For POST and DELETE

Hi,

 

I believe that if you define a different code, that is all you need to do:

Example from SwaggerHub: https://app.swaggerhub.com/apis/djke073/director/1.0.0#/admins/updateJob

alex-savage_0-1594824950497.png

 

There is no 200 on the docs or code.

 

Is that what you are trying to achive?

 

Highlighted
New Contributor

Re: Is there a way to remove the default code(200 OK) For POST and DELETE

let me add my scenario here - In my cases a POST endpoint is used to perform an action which means it may return a 201 instead of a 200. However by default the swagger configuration adds a 200 for every POST call.

 

Capture.PNG

Highlighted
Occasional Contributor

Re: Is there a way to remove the default code(200 OK) For POST and DELETE

Can you share your API definition or a URL please and Ill take a look if that helps?

 

Tags (1)
New Here?
Join us and watch the welcome video:
Announcements