Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Rwing/OcelotSwagger

This library makes ocelot easy to integrate swagger
https://github.com/Rwing/OcelotSwagger

Last synced: about 2 months ago
JSON representation

This library makes ocelot easy to integrate swagger

Awesome Lists containing this project

README

        

# OcelotSwagger

[![NuGet][main-nuget-badge]][main-nuget]

[main-nuget]: https://www.nuget.org/packages/OcelotSwagger/
[main-nuget-badge]: https://img.shields.io/nuget/v/OcelotSwagger.svg?style=flat-square&label=nuget

This library makes ocelot easy to integrate swagger

## Installation

```bash
Install-Package OcelotSwagger
```

## Usage

In method `ConfigureServices`
```csharp
// Load options from code
services.AddOcelotSwagger(c =>
{
c.Cache.Enabled = true;
c.SwaggerEndPoints.Add(new SwaggerEndPoint { Name = "Api Name", Url = "/path/swagger.json" });
});
```
Or
```csharp
// Load options from appsettings.json
services.Configure(this.configuration.GetSection(nameof(OcelotSwaggerOptions)));
services.AddOcelotSwagger();
```

In method `Configure`
```csharp
app.UseOcelotSwagger();
```

## TODO
* [x] Cache

## Contributor
@Cyril MARTY (https://github.com/DotNetConcept)