-
-
Save justinyoo/c48baf3f0623d5c34eb9a694aacec580 to your computer and use it in GitHub Desktop.
Swashbuckle Pro Tips for ASP.NET Web API #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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