-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding ProducesResponseTypeAttribute(int statusCode) constructor #4863
Comments
This doesnt work at all imho .., swagger only has a single response generated so i dont know how you can go 404 with null or an object,with 200. Especially with proxies with hard checks . "responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Config"
}
} |
@bklooste - Can you provide an example of the action + attributes that you think isn't working right? We can figure out if this is a problem on our side or not. |
@rynowak is the work item here (as far as we know) to add a new @domaindrivendev would this satisfy your suggestion? |
I ran into the same issue. I've been adding the following into each of my new projects:
|
Let's add the |
When will this land on NuGet? Just updated to 1.1.0-preview1-final and it's not there yet. |
It didn't make it to the preview but it will be in the 1.1.0 release! |
Sorry to dig up this old issue. I'm really late to the game, but I just went through this same thought process and discovered this thread. |
Is there a convenient way to indicate additional HTTP status codes for an API action, without specifying a response type? For example, with a 404 response, it's extremely common to return no content in the response body. It looks like the following syntax is required for this:
This is probably fine but gives me a "niggly" feeling that the semantics for ProducesResponseType don't quite align with typical API design. In HTTP, there's ALWAYS a status code and OPTIONALLY a response body. IMO, this reality would be better reflected by renaming the attribute to "ProducesResponse" (or even just "Produces") with an optional Type parameter:
Perhaps I'm missing something so would be great to hear other's opinions. It's not the end of the world either way but just wanted to put forward my two cents.
The text was updated successfully, but these errors were encountered: