Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Nancy.Metadata.Swagger/Fluent/SwaggerEndpointInfoExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nancy.Metadata.Swagger.Model;
using Newtonsoft.Json.Schema;
using Newtonsoft.Json.Schema.Generation;
using System.Linq;

namespace Nancy.Metadata.Swagger.Fluent
{
Expand Down Expand Up @@ -83,6 +84,20 @@ public static SwaggerEndpointInfo WithRequestModel(this SwaggerEndpointInfo endp
return endpointInfo;
}

public static SwaggerEndpointInfo WithTags(this SwaggerEndpointInfo info, IEnumerable<string> tags)
{
info.Tags = tags.ToArray();

return info;
}

public static SwaggerEndpointInfo WithMethodName(this SwaggerEndpointInfo info, string name)
{
info.MethodName = name;

return info;
}

public static SwaggerEndpointInfo WithDescription(this SwaggerEndpointInfo endpointInfo, string description, params string[] tags)
{
if (endpointInfo.Tags == null)
Expand Down
3 changes: 3 additions & 0 deletions Nancy.Metadata.Swagger/Model/SwaggerEndpointInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class SwaggerEndpointInfo
[JsonProperty("description")]
public string Description { get; set; }

[JsonProperty("operationId")]
public string MethodName { get; set; }

[JsonProperty("responses")]
public Dictionary<string, SwaggerResponseInfo> ResponseInfos { get; set; }

Expand Down