Coder Social home page Coder Social logo

auto-docs's Introduction

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:[email protected]")] {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!

auto-docs's People

Contributors

santthosh avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.