Code Monkey home page Code Monkey logo

apihelp's Introduction

Microsoft.AspNetCore.ApiHelp

A toolchain for ASP.NET Core to automatically generating API documentation.

Features

  • Read XML comments at run time (so the deployment need to include yourAssembly.xml file).

  • Get Enum raw constant value and XML comments.

    public enum Gender {
        /// <summary>
        /// 未知.
        /// </summary>
        Unknown,
        /// <summary>
        /// 男性.
        /// </summary>
        Male,
        /// <summary>
        /// 女性.
        /// </summary>
        Female,
    }
    {
      "0": "未知", 
      "1": "男性", 
      "2": "女性"
    }
  • Generate API documentation for ASP.NET Core.

  • JsonOutputFormatter use camel case or not determined by the API (Because it's API).

  • More...

Running from demo

To integrate ApiHelp to your project, download this repo and see Host source code, running and open link api/help/ui in your browser to view the result.

Packages

How to use

Install package.

PM> Install-Package Microsoft.AspNetCore.ApiHelp

Configure Startup.cs.

public void ConfigureServices(IServiceCollection services) {
    services.AddMvc()
        .AddApiHelp(options => {
            options.IgnoreObsoleteApi = true;
            options.GenerateStrategy = DocumentGenerateStrategy.Eager;
            options.IncludeSupportedMediaType = false;
        });
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
    loggerFactory.AddConsole(Configuration.GetSection("Logging"));

    app.UseApiHelp(new ApiHelpUIOptions {
        Title = "API toolchain for ASP.NET Core",
        UI = ApiHelpUI.Swagger,
    });

    app.UseMvc();
}

apihelp's People

Contributors

rigofunc avatar

Watchers

 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.