-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
I would like to be able to just enforce descriptions for status codes. e.g.:
ChangeAllResponsesByHttpStatusCode(StatusCodes.Status404NotFound, "BadRequest. One or more inputs are invalid.");
I'd assume this should be supported because responseExampleOption and responseExample default to none/null. However, this doesn't work.
First, it requires a generic argument even when no responseExample is passed, which makes no sense. But ok, I tried
ChangeAllResponsesByHttpStatusCode<object>(StatusCodes.Status404NotFound, "BadRequest. One or more inputs are invalid.");
But then I get this error:
InvalidOperationException: A suitable constructor for type 'Unchase.Swashbuckle.AspNetCore.Extensions.Filters.ChangeResponseByHttpStatusCodeDocumentFilter`1[System.Object]' could not be located. Ensure the type is concrete and all parameters of a public constructor are either registered as services or passed as arguments. Also ensure no extraneous arguments are provided.
A new overload for ChangeAllResponsesByHttpStatusCode that just handles descriptions would be nice.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels