GithubHelp home page GithubHelp logo

fnldesign / webapidocsamples Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 772 KB

Tests with Web API - API Dcoumentation Tools - API Help Pages and Swagger

C# 88.43% CSS 1.63% ASP 0.06% JavaScript 9.88%
swagger webapi webapi-2 dotnet visual-studio api api-documentation api-management xmldoc

webapidocsamples's Introduction

Build status

Web API - Documentation - Samples

Tests with Web API - API Documentation Tools - API Help Pages and Swagger

Swagger - API Documentation

Swagger is a API Documentation Tool, intagrated on Visual Studio by Nuget Packages

See more at Swagger website.

I´m using Swashbuckle Visual Studio Nuget Package

To see a tutorial using .NET Web API and Swagger see more at Swashbuckle GitHub Repo

See Swagger UI in action bellow Swagger UI

.NET Web API - Help Pages

.NET Web API - Help Pages is a collection of Views to Genarate API Help Pages

I´m using WebApiTestClient too, to add a Test Client on API Help Pages. If you want, you see how to add WebApiTestClient into this tutorial Adding a simple Test Client to ASP.NET Web API Help Page

See more at HelpPages on Microsoft Website. This MS Blog Post is usefull too Introducing the ASP.NET Web API Help Page.

See Web API Test Client bellow Web Api Test Client

On the Code

Swashbuckle Configurations

To enable Swagger to use XmlDoc, use c.IncludeXmlComments(GetXmlCommentsPath());

I suggested to place XmlDoc in App_Data Folder above a sample of GetXmlCommentsPath() method

   private static string GetXmlCommentsPath()
   {            
            var basePath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/");
            var xmlDocPath = System.IO.Path.Combine(basePath, "XmlDocument.xml");
            return xmlDocPath;
   }

Sample Web API v2 Controller to documentation

Sample code - XmlDoc to Genarate API Doc

        /// <summary>
        /// Obtêm todos os produtos
        /// </summary>
        /// <returns>Retorna uma lista com todos os produtos</returns>
        public List<Models.Produto> Get()
        {
            return produtos;
        }

webapidocsamples's People

Contributors

fnldesign avatar

Stargazers

 avatar

Watchers

James Cloos 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.