Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the list of accepted media types in the Swagger spec properties "consumes" and "produces" #11

Open
steve-jansen opened this issue Jul 25, 2013 · 0 comments
Assignees

Comments

@steve-jansen
Copy link
Owner

The Swagger UI lists the available "Response Content Type" as a drop down of media types, like application/json or 'text/xml`

The list of supported media types in WebAPI should be queried via something like:

HttpConfiguration configuration;
List<string> list = new List<string>();

foreach(var formatter in configuration.Formatters)
{
    foreach(var mediaType in formatter.SupportedMediaTypes)
    {
        list.Add(mediaType.MediaType);
    }
}

list.Sort();

return list;

In theory, this list could be used for both the consumes and produces properties of an API.

See more:

@ghost ghost assigned steve-jansen Jul 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant