Giter Site home page Giter Site logo

scalar.net's Introduction

Scalar.Net

GitHub Repo stars

This project is a simple middleware that will expose Scalar documentation for your .NET API on the route which you want for your Swagger/OpenApi specs.

Installation

You can install this easily from Nuget on the following location:

NuGet

Usage

After installation you'll need to alter your startup and add Scalar to the services. You can to this by calling next method:

//map configuration to scalar options
builder.Services.AddScalar(opts => builder.Configuration.GetSection("Scalar").Bind(opts));

//or manually set them
builder.Services.AddScalar(opts => 
{
    opts.Theme = ScalarLayoutType.Modern;
});

Available configuration options are located here. And they closely mimic the configuration on the related node packages over on original Scalar repository. You can find original configuration on this link.

After configuring options be sure to also include Scalar middlware in your pipeline in order to show the documentation. You can do this by simply calling next method:

//map scalar endpoint wherever you want
app.Map("/docs", a =>
{
    a.UseScalar();
});

And that is it. Simply visit the related endpoint and you should see your spec generate the related documentation and run the Scalar app in browser.

Examples

Examples directory contains a sample project which has swagger and scalar integrated so you can more closely follow how to set this up. Few images of this can be found below:

Documentation page: Scalar documentation

Documentation request editor: Scalar documentation

License

MIT

scalar.net's People

Contributors

denispav 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.