You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope this is the best place to post this, if not my apologies.
We are owning a Web Api both client and server side, and we developed a method that can return a null answer in some cases
The associated Json documentation
However, when the client is generated with Nswag :
There is a mandatory null check in case of a 200 response
A possible 204 answer is not taken into account.
I did try to add a 204 attribute server side, and this does add a 204 status check on the server side, but within the 204 check, it will nevertheless throw an exception
I am starting to get a bit out of ideas and I have to admit i am not so familiar with the swagger/swashbuckle/Nswag ecosystem.I did try to google it a bit and i found those (one year) old answers but I was wondering if there was any workaround at the moment?
We do not partcularly need to return a 204 answer in case of a null content (ASP does it automatically), so if there is a way to return a null 200 response and to suppress the null check for this method, I will take it.
So far, we are writing a partial class client with a specific 204 handling case, but we need to do some tweaking everytime we refresh the client. This works, but this is not ideal.
Thank you very much for your help,
Kind regards
The text was updated successfully, but these errors were encountered:
Hi everybody,
I hope this is the best place to post this, if not my apologies.
We are owning a Web Api both client and server side, and we developed a method that can return a null answer in some cases
The associated Json documentation
However, when the client is generated with Nswag :
I did try to add a 204 attribute server side, and this does add a 204 status check on the server side, but within the 204 check, it will nevertheless throw an exception
I am starting to get a bit out of ideas and I have to admit i am not so familiar with the swagger/swashbuckle/Nswag ecosystem.I did try to google it a bit and i found those (one year) old answers but I was wondering if there was any workaround at the moment?
#1602
We do not partcularly need to return a 204 answer in case of a null content (ASP does it automatically), so if there is a way to return a null 200 response and to suppress the null check for this method, I will take it.
So far, we are writing a partial class client with a specific 204 handling case, but we need to do some tweaking everytime we refresh the client. This works, but this is not ideal.
Thank you very much for your help,
Kind regards
The text was updated successfully, but these errors were encountered: