Add support for Newtonsoft annotations in Swagger

This commit is contained in:
sephrat 2022-05-13 13:21:15 +02:00
commit 26e25cca55
3 changed files with 7 additions and 0 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Ombi.Api.Plex.Models
{
@ -38,6 +39,9 @@ namespace Ombi.Api.Plex.Models
public string grandparentTheme { get; set; }
public string chapterSource { get; set; }
public Medium[] Media { get; set; }
[JsonProperty("guids")]
public List<PlexGuids> Guid { get; set; } = new List<PlexGuids>();
}

View file

@ -79,6 +79,8 @@ namespace Ombi
c.DescribeAllParametersInCamelCase();
});
services.AddSwaggerGenNewtonsoftSupport();
}
public static void AddAppSettingsValues(this IServiceCollection services, IConfigurationRoot configuration)

View file

@ -80,6 +80,7 @@
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.3.1" />
<PackageReference Include="System.Security.Cryptography.Csp" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="5.0.0-preview.8.20414.8" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.0" />