0

In a big system, where there are an api for lots of resources, I want split documentation in some configured manner.

Like if they were different apis.

So in main page of web api I have a list of configured 'resources'.

Let's say: Managing contacts [Here i want to expose the 'contact' resource, the 'address' resource, etc. Managing orders [product resource, order resource, delivery resource, balance resource, etc] Managing products [product resource, category resource, etc]

So it's easier for api consumers to understand based on the task to accomplish which methods should been taken care of.

Also, as you can see, different sections use same resources, that means if I change something on the Product resource, both documentations should (ideally) be automatically updated, including versioning info, etc.

EDIT:

    public ActionResult Index()
    {
        ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
        return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
    }

this is my index action on helpcontroller, not sure what you mean.

Bart Calixto
  • 19,210
  • 11
  • 78
  • 114

1 Answers1

1

Have you looked at HelpController under Areas\HelpPage\Controllers? If you notice the Index action of this controller displays information about all controllers. If each of your resource is represented by a controller, you should be able to filter the ApiDescription to only show only the resources that you like to.

Kiran
  • 56,921
  • 15
  • 176
  • 161
  • not sure what you mean, i edited the question with my index action. – Bart Calixto Feb 18 '14 at 14:21
  • As you can notice this index action returns all `ApiDescription` of all controllers or resources in your case. You can filter these descriptions to only show controllers which you would like to show. – Kiran Feb 18 '14 at 15:44