docs(archival): 📝 document endpoints

This commit is contained in:
Collin M. Barrett 2020-10-04 16:10:05 -05:00
parent 95627ee1d3
commit bdb30d2104
4 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,4 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
[*.cs]
dotnet_diagnostic.CS1591.severity = suggestion

View file

@ -8,6 +8,10 @@ namespace FilterLists.Archival.Api.Controllers
[Produces("application/json")]
public class PingController : ControllerBase
{
/// <summary>
/// A sample endpoint.
/// </summary>
/// <returns>Pong.</returns>
[HttpGet]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
#pragma warning disable CA1822 // Mark members as static

View file

@ -4,6 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
<RuntimeIdentifiers>alpine.3.12-x64;win10-x64</RuntimeIdentifiers>
</PropertyGroup>

View file

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
@ -25,6 +27,10 @@ public static void AddSwaggerGen(this IServiceCollection services)
Url = new Uri("https://github.com/collinbarrett/FilterLists/blob/master/LICENSE")
}
});
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
o.IncludeXmlComments(xmlPath);
});
}