I thought Return204NoContentForEmptyResponse
was true by default, but I enabled it anyway,
My Service looks like:
[Route("/dhcp/servers/{ServerName}/scopes/{ScopeId}", "DELETE", Summary = "Deletes a DHCP scope.")]
public class DeleteDhcpScope : IReturnVoid
{
[ApiMember(ParameterType = "path", IsRequired = true, Description = "The FQDN of the DHCP server")]
public string ServerName { get; set; }
[ApiMember(ParameterType = "path", Description ="The Scope Id of the DHCP scope")]
public string ScopeId { get; set; }
}
Resulting view in swagger-ui
One more variable ,f it matters, is that I’ve overridden the default swagger-ui index.html (just the index.html). I’m also using ReDoc, and the default 200 response class shows up there as well.
Things I’ve tried:
[Api(BodyParameter = GenerateBodyParameter.Never)] // doesn't help
[ApiResponse(204, "Option Deleted", ResponseType = typeof(void))] // creates an additional response, doesn't remove 200
[ApiResponse(204, "Option Deleted", ResponseType = typeof(void), IsDefaultResponse = true)] // also creates an additional response with HttpStatusCode set to "default", doesn't remove 200