Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created August 20, 2017 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/c48baf3f0623d5c34eb9a694aacec580 to your computer and use it in GitHub Desktop.
Save justinyoo/c48baf3f0623d5c34eb9a694aacec580 to your computer and use it in GitHub Desktop.
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