Open
Description
The response model of 400 and 500 is the same class: RemoteServiceErrorInfo
But the example is different .
so, I defind two ExamplesProvider are as fallows
[SwaggerResponse(200)]
[SwaggerResponse(400, Type = typeof(RemoteServiceErrorInfo))]
[SwaggerResponseExample(400, typeof(ClentErrorExamples))]
[SwaggerResponse(500, Type = typeof(RemoteServiceErrorInfo))]
[SwaggerResponseExample(500, typeof(ServerErrorExamples))]
public class BaseApiController : ControllerBase
{
}
public class ServerErrorExamples : IExamplesProvider<RemoteServiceErrorInfo>
{
public RemoteServiceErrorInfo GetExamples()
{
return new RemoteServiceErrorInfo
{
Code = "ServerErrorExamples"
};
}
}
public class ClentErrorExamples : IExamplesProvider<RemoteServiceErrorInfo>
{
public RemoteServiceErrorInfo GetExamples()
{
return new RemoteServiceErrorInfo
{
Code = "ClentErrorExamples"
};
}
}
Metadata
Metadata
Assignees
Labels
No labels