Skip to content

Commit

Permalink
Use all media type information, including their parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
commonsensesoftware committed Jul 13, 2017
1 parent 0996fa3 commit 7893ff2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Swashbuckle.Core/Swagger/ApiDescriptionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public static string FriendlyId(this ApiDescription apiDescription)
public static IEnumerable<string> Consumes(this ApiDescription apiDescription)
{
return apiDescription.SupportedRequestBodyFormatters
.SelectMany(formatter => formatter.SupportedMediaTypes.Select(mediaType => mediaType.MediaType))
.SelectMany(formatter => formatter.SupportedMediaTypes.Select(mediaType => mediaType.ToString()))
.Distinct();
}

public static IEnumerable<string> Produces(this ApiDescription apiDescription)
{
return apiDescription.SupportedResponseFormatters
.SelectMany(formatter => formatter.SupportedMediaTypes.Select(mediaType => mediaType.MediaType))
.SelectMany(formatter => formatter.SupportedMediaTypes.Select(mediaType => mediaType.ToString()))
.Distinct();
}

Expand Down

0 comments on commit 7893ff2

Please sign in to comment.