From 6af6364f4e8bc4e5b02455bd38d7fde616ad63e5 Mon Sep 17 00:00:00 2001 From: Ashish Gandhi Date: Wed, 2 Mar 2016 17:05:27 +0530 Subject: [PATCH] Added an extension method named "WithTags" to allow specifying the tags for an API to categorize it in Swagger. --- .../Fluent/SwaggerEndpointInfoExtensions.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Nancy.Metadata.Swagger/Fluent/SwaggerEndpointInfoExtensions.cs b/Nancy.Metadata.Swagger/Fluent/SwaggerEndpointInfoExtensions.cs index 945136b..5e2abb5 100644 --- a/Nancy.Metadata.Swagger/Fluent/SwaggerEndpointInfoExtensions.cs +++ b/Nancy.Metadata.Swagger/Fluent/SwaggerEndpointInfoExtensions.cs @@ -39,6 +39,16 @@ public static SwaggerEndpointInfo WithResponse(this SwaggerEndpointInfo endpoint return endpointInfo; } + public static SwaggerEndpointInfo WithTags(this SwaggerEndpointInfo endpointInfo, params string[] tags) + { + if (endpointInfo.Tags == null) + { + endpointInfo.Tags = tags; + } + + return endpointInfo; + } + public static SwaggerEndpointInfo WithRequestParameter(this SwaggerEndpointInfo endpointInfo, string name, string type = "string", string format = null, bool required = true, string description = null, string loc = "path")