I have created reference documentation for my api 2 projects (based on owin / katana). I turned on all the settings in the configuration and installed Microsoft.AspNet.WebApi.OData. I currently have the following settings:
config.SetSampleObjects(new Dictionary<Type, object>
{
{typeof(string), "sample string"},
{typeof(IEnumerable<string>), new string[]{"sample 1", "sample 2"}}
});
config.SetSampleForMediaType(
new TextSample("Binary JSON content. See http://bsonspec.org for details."),
new MediaTypeHeaderValue("application/bson"));
config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable<string>));
config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put");
config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "Get", "id");
config.SetActualRequestType(typeof(string), "Values", "Get");
config.SetActualResponseType(typeof(string), "Values", "Post");
However, I am not creating any sample response. My page should look like I saw on the Internet

but it is so. How can I display sample responses, such as JSON, as shown in the first snapshot?

Cemre source
share