-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Do not throw on 204, return default response #4257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Do not throw on 204, return default response #4257
Conversation
|
Since 204 is handled in Typescript generator, it seems to make sense to handle it in C# as well |
|
Any estimate on merging this in? Could use this as well. |
|
@RicoSuter any chance this can make it into the next release? It's the last manual template update I maintain for our org. |
|
A gentle bump, no merge conflicts. |
|
I know there are a few other open issues and PRs regarding 204 responses, but mine seems to be simple and correct for now. Future enhancements are still possible, but this has been working in our org for quite some time. I'm just getting tired of maintaining the template override with every new nswag release. Any chance I could at least get some feedback if this is being considered? |
|
I am also very keen to get this one in place |
|
Please also add some tests covering this change and fix the build errors. Then it's fine to merge. |
Can you give me some guidance on what tests you would like added and where? If there's an example to go off that should be sufficient. |
|
We have some snapshot based tests here: I think we should add a sample minimal openapi with a 204 and 200 in it (etc) and generate a typescript from it and snapshot so that we have this feature under test.. |
A 204 response is successful and it is expected that there is no body. Therefore the client should return the
default(T)response instead of throwing a null response exception.