diff --git a/docs.sh b/docs.sh index 39622a8c4..bd7408505 100644 --- a/docs.sh +++ b/docs.sh @@ -1,3 +1,7 @@ +#!/bin/bash +set -e + +FRAMEWORK="net6.0" PLATFORM=$1 if [ "$PLATFORM" = "Windows" ]; then @@ -21,15 +25,21 @@ slnFile=src/Readarr.sln platform=Posix +if [ "$PLATFORM" = "Windows" ]; then + application=Readarr.Console.dll +else + application=Readarr.dll +fi + dotnet clean $slnFile -c Debug dotnet clean $slnFile -c Release dotnet msbuild -restore $slnFile -p:Configuration=Debug -p:Platform=$platform -p:RuntimeIdentifiers=$RUNTIME -t:PublishAllRids dotnet new tool-manifest -dotnet tool install --version 6.5.0 Swashbuckle.AspNetCore.Cli +dotnet tool install --version 6.6.2 Swashbuckle.AspNetCore.Cli -dotnet tool run swagger tofile --output ./src/Readarr.Api.V1/openapi.json "$outputFolder/net6.0/$RUNTIME/Readarr.console.dll" v1 & +dotnet tool run swagger tofile --output ./src/Readarr.Api.V1/openapi.json "$outputFolder/$FRAMEWORK/$RUNTIME/$application" v1 & sleep 45 diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 557086928..c9edf98a3 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -46,7 +46,8 @@ - + + diff --git a/src/Readarr.Api.V1/Books/BookResource.cs b/src/Readarr.Api.V1/Books/BookResource.cs index db49b06bb..56366cd08 100644 --- a/src/Readarr.Api.V1/Books/BookResource.cs +++ b/src/Readarr.Api.V1/Books/BookResource.cs @@ -7,6 +7,7 @@ using NzbDrone.Core.Books; using NzbDrone.Core.MediaCover; using Readarr.Api.V1.Author; using Readarr.Http.REST; +using Swashbuckle.AspNetCore.Annotations; namespace Readarr.Api.V1.Books { @@ -38,6 +39,7 @@ namespace Readarr.Api.V1.Books //Hiding this so people don't think its usable (only used to set the initial state) [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] + [SwaggerIgnore] public bool Grabbed { get; set; } } diff --git a/src/Readarr.Api.V1/Books/EditionResource.cs b/src/Readarr.Api.V1/Books/EditionResource.cs index 8e76b4130..4e59bf67f 100644 --- a/src/Readarr.Api.V1/Books/EditionResource.cs +++ b/src/Readarr.Api.V1/Books/EditionResource.cs @@ -5,6 +5,7 @@ using Newtonsoft.Json; using NzbDrone.Core.Books; using NzbDrone.Core.MediaCover; using Readarr.Http.REST; +using Swashbuckle.AspNetCore.Annotations; namespace Readarr.Api.V1.Books { @@ -33,6 +34,7 @@ namespace Readarr.Api.V1.Books //Hiding this so people don't think its usable (only used to set the initial state) [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] + [SwaggerIgnore] public bool Grabbed { get; set; } } diff --git a/src/Readarr.Api.V1/Readarr.Api.V1.csproj b/src/Readarr.Api.V1/Readarr.Api.V1.csproj index bbd8a4090..a23ef65fa 100644 --- a/src/Readarr.Api.V1/Readarr.Api.V1.csproj +++ b/src/Readarr.Api.V1/Readarr.Api.V1.csproj @@ -9,10 +9,11 @@ - + +