Skip to content

Autodocs - WCF REST Automatic API Documentation Generator

License

Notifications You must be signed in to change notification settings

santthosh/auto-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project Description Autodocs is an automatic API documentation generator for .NET applications that use Windows Communication Foundation (WCF) to establish REST API's.

How to use Autodocs to document your WCF REST API?

  1. Download library and reference Autodocs.ServiceModel.Web.dll in your WCF WebServices project

  2. Modify the Web.config's system.ServiceModel section of the WCF WebServices project as illustrated below a) Add a behavior extension {code:xml}

{code:xml} Note: It's very important to have the fully qualified assembly name (since WCF has a [bug](http://connect.microsoft.com/wcf/feedback/details/216431/wcf-fails-to-find-custom-behaviorextensionelement-if-type-attribute-doesnt-match-exactly) on the behavior extension element)

b) Reference the behavior extension in endpoint behavior {code:xml} {code:xml} Here is a sample Web.config

Note: It's very important to maintain the order of behaviors, in the endpointBehaviors element. If you specify autodocs first, you might not get the desired documentation, as webHttp will override autodocs message inspectors

c) Start documenting your Service interface as shown below {code:c#} [WebServiceDoc(Title="Users REST API Documentation", Description = "Web Services API for user management in the foo system.", SupportLink = "mailto:santthosh@notionforge.com")] {code:c#} d) Start documenting your Operations as shown below {code:c#} [WebOperationDoc(Description = "Update an existing user in the system. If UserId is invalid, null or doesn't exist it throws HTTP 404 - Not found.")] {code:c#} e) Deploy or launch your service, the documentation should be automatically availabe in '/docs'

Service Documentation: http://servername/{servicename}.svc/docs (http://myserver/users.svc/docs)

Operation Documentation: http://servername/{servicename}.svc/{operation}/docs (http://myserver/users.svc/adduser/docs)

Screen Shots

a) Sample Service Documentation

b) Sample XML Operation Documentation

c) Sample JSON Operation Documentation

Thank you!

About

Autodocs - WCF REST Automatic API Documentation Generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages