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 am not able to show status code 201,400,500,404 etc on swagger ui page Like (Response class (Status 200). It's always showing "Status 200". I have to show status code for created 201,Forbidden 403, BadRequest 400. I have also used swashbuckle.example dll.
This is my class
public class EmployeeExample: IExamplesProvider
{
public object GetExamples()
{
return new Employee(){
ID=0,
Name="Jitu",
City="Noida"
}
}
This is my method in controller:-
[HttpPost
[SwaggerResponse(HttpStatusCode.Creted, Type = typeof(IEnumerable))]
public HttpResponseMessage Get(string lang)
{
Return Request,CreateResponse(HttpStatusCode.Created, objectyofresponse);
}
I am not able to show status code 201,400,500,404 etc on swagger ui page Like (Response class (Status 200). It's always showing "Status 200". I have to show status code for created 201,Forbidden 403, BadRequest 400. I have also used swashbuckle.example dll.
This is my class
public class EmployeeExample: IExamplesProvider
{
public object GetExamples()
{
return new Employee(){
ID=0,
Name="Jitu",
City="Noida"
}
}
This is my method in controller:-
[HttpPost
[SwaggerResponse(HttpStatusCode.Creted, Type = typeof(IEnumerable))]
public HttpResponseMessage Get(string lang)
{
Return Request,CreateResponse(HttpStatusCode.Created, objectyofresponse);
}
I want to shwo like this.
is the below issue closed ?
swagger-api/swagger-ui#1117
mattfrear/Swashbuckle.AspNetCore.Filters#9
Please let me know how can i show status code with example value.
The text was updated successfully, but these errors were encountered: