Create a gist now

Instantly share code, notes, and snippets.

@justinyoo /Requests.cs Secret
Created Aug 20, 2017

What would you like to do?
Swashbuckle Pro Tips for ASP.NET Web API #3
public class Requests : ISchemaFilter
{
private readonly IEnumerable<Type> _types;
public Requests(params Type[] types)
{
if (types == null)
{
throw new ArgumentNullException(nameof(types));
}
this._types = types;
}
public void Apply(Schema schema, SchemaRegistry schemaRegistry, Type type)
{
if (!this._types.Contains(type))
{
return;
}
schema.xml = new Xml() { name = "request" };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment