Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to 13.20.0 #89

Merged
merged 43 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a428037
Update README.md
RicoSuter Nov 24, 2022
fca7e81
Add nswag.cmd (#4255)
RicoSuter Dec 7, 2022
993f2df
v13.18.1
RicoSuter Dec 7, 2022
81189c6
Merge branch 'master' of https://github.com/RicoSuter/NSwag
RicoSuter Dec 15, 2022
7767e71
v13.18.2
RicoSuter Dec 15, 2022
3ee148a
Remove description from OpenApiResponse when serializing for Swagger …
PatrickHofman Jan 17, 2023
8a01926
Add check for IsBindingAllowed so that BindNever attribute works corr…
RicoSuter May 2, 2023
c527a94
Add CS0612 to the File.Header.liquid (#4409)
trejjam May 2, 2023
9eef2bf
Update Client.Class.liquid (#4402)
jeanluc162 May 2, 2023
01bb927
Descriptive exception for duplicate XML doc line (#2863) (#4388)
aviita May 2, 2023
85b2a6b
Revert PR #4314
RicoSuter May 2, 2023
f02c425
v13.18.3
RicoSuter May 2, 2023
c9208a4
Improve NRT support for API parameters
May 3, 2023
52939b3
Required path parameters are not nullable (when NRT is off)
May 3, 2023
e5b73cb
v13.18.4
May 3, 2023
bdba0a8
Add enforceNotNull parameter and use for required path parameters
May 3, 2023
9748087
v13.18.5
May 3, 2023
06feb51
Add File.Footer.liquid (#4411)
trejjam May 3, 2023
65e9f39
Swagger UI v4.18.3, closes #4311 and #4387 (v13.18.5)
May 3, 2023
480d1e2
Merge branch 'master' of https://github.com/RicoSuter/NSwag
May 3, 2023
73ac020
add axios abort signal (#4282)
fmg-lydonchandra May 3, 2023
cef32ca
Add support for MSBuild transitive dependency flow #4026 (#4338)
DanielTheCoder May 3, 2023
1868e99
Use GNU tar for cache and install .NET in single step (#4251)
lahma May 3, 2023
fb37aa2
Unwrap ValueTask<T> return types (#4374)
alasdaircs May 3, 2023
0ce206e
cleanup
May 3, 2023
36e1004
NJsonSchema v10.9.0
May 3, 2023
21bf926
Fix build
May 3, 2023
21e5b69
Revert "Fix build"
May 3, 2023
06a0f66
Fix build
May 3, 2023
8cdbbcd
Fix dep
May 3, 2023
82708d1
Add .NET 5 SDK
May 3, 2023
73bc1c4
Improve build
May 3, 2023
92b168a
v13.19.0
May 3, 2023
8d120cd
fix default value docs of SerializeTypeInformation, closes #4480
Aug 15, 2023
b819344
Add SwaggerRoutesFactory to SwaggerUi3Settings
Aug 15, 2023
57f6b27
Disable warning CS8604 "Possible null reference argument for paramete…
NoahStolk Aug 15, 2023
f612076
Update Client.Class.liquid (#4471)
Alireza2125 Aug 15, 2023
ca23624
install .net 3.1 sdk
Aug 15, 2023
75a2c73
v13.20.0
Aug 15, 2023
6f5e5f9
Set ChocolateyPush source
Aug 15, 2023
7fb8faa
Merged from 13.20.0
shuruev Nov 16, 2023
7145ed5
Post-merge adjustments
shuruev Nov 16, 2023
a4b957d
Updated more Newtonsoft.Json versions, for consistency
shuruev Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,20 @@ jobs:
steps:
- name: 'Allow long file path'
run: git config --system core.longpaths true
- uses: actions/checkout@v1
- if: ${{ runner.os == 'Windows' }}
name: 'Use GNU tar'
shell: cmd
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 2.1.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.*
dotnet-version: |
2.1.*
5.0.*
- uses: actions/checkout@v3
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.nuke/temp
Expand All @@ -64,7 +60,7 @@ jobs:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: artifacts
26 changes: 11 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,20 @@ jobs:
steps:
- name: 'Allow long file path'
run: git config --system core.longpaths true
- uses: actions/checkout@v1
- if: ${{ runner.os == 'Windows' }}
name: 'Use GNU tar'
shell: cmd
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 2.1.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.*
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.*
dotnet-version: |
2.1.*
5.0.*
- uses: actions/checkout@v3
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.nuke/temp
Expand Down
9 changes: 5 additions & 4 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"properties": {
"ChocoApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secret [profile]'"
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"Configuration": {
"type": "string",
Expand All @@ -33,6 +33,7 @@
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
Expand All @@ -48,19 +49,19 @@
},
"MyGetApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secret [profile]'"
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"NpmAuthToken": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secret [profile]'"
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"NuGetApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secret [profile]'"
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"Partition": {
"type": "string",
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ NSwag | [NJsonSchema](http://njsonschema.org) | [Apimundo](https://apimundo.com)
[![npm](https://img.shields.io/npm/v/nswag.svg)](https://www.npmjs.com/package/nswag)
[![MyGet](https://img.shields.io/myget/nswag/v/NSwag.Core.svg?label=preview%20nuget)](https://www.myget.org/feed/Packages/nswag)
[![build](https://github.com/RicoSuter/NSwag/actions/workflows/build.yml/badge.svg)](https://github.com/RicoSuter/NSwag/actions/workflows/build.yml)
[![Gitter](https://img.shields.io/badge/gitter-join%20chat-1dce73.svg)](https://gitter.im/NSwag/NSwag)
[![Discord](https://img.shields.io/badge/Discord-join%20chat-1dce73.svg)](https://discord.gg/4x48JjUT)
[![Discord](https://img.shields.io/badge/Discord-join%20chat-1dce73.svg)](https://discord.gg/BxQNy25WF6)
[![StackOverflow](https://img.shields.io/badge/questions-on%20StackOverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/nswag)
[![Wiki](https://img.shields.io/badge/docs-in%20wiki-orange.svg?style=flat)](https://github.com/RicoSuter/nswag/wiki)
[![Backers on Open Collective](https://opencollective.com/NSwag/backers/badge.svg)](#backers)
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ else {
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
}

Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"

ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
fi

echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"

"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
55 changes: 44 additions & 11 deletions build/Build.CI.GitHubActions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Nuke.Common.CI.GitHubActions;
using Nuke.Common.CI.GitHubActions.Configuration;
using Nuke.Common.Execution;
using Nuke.Common.Utilities;

[CustomGitHubActionsAttribute(
[CustomGitHubActions(
"pr",
GitHubActionsImage.WindowsServer2022,
// GitHubActionsImage.UbuntuLatest,
Expand All @@ -16,7 +17,7 @@
InvokedTargets = new[] { nameof(InstallDependencies), nameof(Compile), nameof(Test), nameof(Pack) },
CacheKeyFiles = new[] { "global.json", "src/**/*.csproj", "src/**/package.json" }),
]
[CustomGitHubActionsAttribute(
[CustomGitHubActions(
"build",
GitHubActionsImage.WindowsServer2022,
// GitHubActionsImage.UbuntuLatest,
Expand Down Expand Up @@ -45,14 +46,15 @@ protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyC
var job = base.GetJobs(image, relevantTargets);

var newSteps = new List<GitHubActionsStep>(job.Steps);
foreach (var version in new[] { "7.0.*", "6.0.*", "5.0.*", "3.1.*", "2.1.*" })

// only need to list the ones that are missing from default image
newSteps.Insert(0, new GitHubActionsSetupDotNetStep(new[]
{
newSteps.Insert(1, new GitHubActionsSetupDotNetStep
{
Version = version
});
}

"2.1.*",
"5.0.*"
}));

newSteps.Insert(0, new GitHubActionsUseGnuTarStep());
newSteps.Insert(0, new GitHubActionsConfigureLongPathsStep());

job.Steps = newSteps.ToArray();
Expand All @@ -74,7 +76,12 @@ public override void Write(CustomFileWriter writer)

class GitHubActionsSetupDotNetStep : GitHubActionsStep
{
public string Version { get; init; }
public GitHubActionsSetupDotNetStep(string[] versions)
{
Versions = versions;
}

string[] Versions { get; }

public override void Write(CustomFileWriter writer)
{
Expand All @@ -85,8 +92,34 @@ public override void Write(CustomFileWriter writer)
writer.WriteLine("with:");
using (writer.Indent())
{
writer.WriteLine($"dotnet-version: {Version}");
writer.WriteLine("dotnet-version: |");
using (writer.Indent())
{
foreach (var version in Versions)
{
writer.WriteLine(version);
}
}
}
}
}
}

class GitHubActionsUseGnuTarStep : GitHubActionsStep
{
public override void Write(CustomFileWriter writer)
{
writer.WriteLine("- if: ${{ runner.os == 'Windows' }}");
using (writer.Indent())
{
writer.WriteLine("name: 'Use GNU tar'");
writer.WriteLine("shell: cmd");
writer.WriteLine("run: |");
using (writer.Indent())
{
writer.WriteLine("echo \"Adding GNU tar to PATH\"");
writer.WriteLine("echo C:\\Program Files\\Git\\usr\\bin>>\"%GITHUB_PATH%\"");
}
}
}
}
1 change: 1 addition & 0 deletions build/Build.Publish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public partial class Build
ChocolateyPush(_ => _
.SetApiKey(ChocoApiKey)
.SetPathToNuGetPackage(ArtifactsDirectory.GlobFiles("NSwagStudio.*.nupkg").Single())
.SetSource("https://push.chocolatey.org/")
);

try
Expand Down
4 changes: 1 addition & 3 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.Build.Evaluation;
using Microsoft.Build.Locator;
using Nuke.Common;
using Nuke.Common.Execution;
using Nuke.Common.Git;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
Expand All @@ -18,7 +17,6 @@
using Nuke.Common.Utilities.Collections;

using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Logger;
using static Nuke.Common.Tooling.ProcessTasks;
using static Nuke.Common.Tools.Chocolatey.ChocolateyTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
Expand All @@ -27,7 +25,6 @@
using static Nuke.Common.Tools.VSTest.VSTestTasks;
using Project = Nuke.Common.ProjectModel.Project;

[CheckBuildProjectConfigurations]
partial class Build : NukeBuild
{
public Build()
Expand Down Expand Up @@ -125,6 +122,7 @@ protected override void OnBuildInitialized()
{
Chocolatey("install wixtoolset -y");
Chocolatey("install netfx-4.6.1-devpack -y");
Chocolatey("install dotnetcore-3.1-sdk -y");
NpmInstall(x => x
.EnableGlobal()
.AddPackages("dotnettools")
Expand Down
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.0.1" />
<PackageReference Include="Nuke.Common" Version="6.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<PropertyGroup>
<VersionPrefix>13.18.0</VersionPrefix>
<VersionPrefix>13.20.0</VersionPrefix>

<Authors>Rico Suter</Authors>
<Copyright>Copyright © Rico Suter, 2021</Copyright>
<Copyright>Copyright © Rico Suter, 2023</Copyright>

<Description>NSwag: The OpenAPI/Swagger API toolchain for .NET and TypeScript</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Owin;
using NSwag.Generation;
Expand Down Expand Up @@ -30,7 +31,7 @@ public override async Task Invoke(IOwinContext context)
{
context.Response.Headers["Content-Type"] = "text/html; charset=utf-8";
context.Response.StatusCode = 200;
context.Response.Write(_settings.TransformHtml(reader.ReadToEnd(), context.Request));
context.Response.Write(await _settings.TransformHtmlAsync(reader.ReadToEnd(), context.Request, CancellationToken.None));
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.AspNet.Owin/SwaggerUi3/swagger-ui-bundle.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/NSwag.AspNet.Owin/SwaggerUi3/swagger-ui-es-bundle.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/NSwag.AspNet.Owin/SwaggerUi3/swagger-ui.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/NSwag.AspNet.Owin/SwaggerUi3/swagger-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/NSwag.AspNet.WebApi/NSwag.AspNet.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.3" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.3" />
<PackageReference Include="NJsonSchema" Version="10.8.0" />
<PackageReference Include="NJsonSchema" Version="10.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NSwag.Annotations\NSwag.Annotations.csproj" />
Expand Down
6 changes: 4 additions & 2 deletions src/NSwag.AspNetCore/ApiverseUiSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//-----------------------------------------------------------------------

using Microsoft.AspNetCore.Http;
using System.Threading;
using System.Threading.Tasks;

namespace NSwag.AspNetCore
{
Expand All @@ -31,9 +33,9 @@ public ApimundoUiSettings()
/// </summary>
public string ApimundoUrl { get; set; } = "https://apimundo.com";

internal override string TransformHtml(string html, HttpRequest request)
internal override Task<string> TransformHtmlAsync(string html, HttpRequest request, CancellationToken cancellationToken)
{
return html;
return Task.FromResult(html);
}
}
}
6 changes: 5 additions & 1 deletion src/NSwag.AspNetCore/Middlewares/SwaggerUiIndexMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public async Task Invoke(HttpContext context)
{
context.Response.Headers["Content-Type"] = "text/html; charset=utf-8";
context.Response.StatusCode = 200;
await context.Response.WriteAsync(_settings.TransformHtml(await reader.ReadToEndAsync(), context.Request));
await context.Response.WriteAsync(
await _settings.TransformHtmlAsync(
await reader.ReadToEndAsync(),
context.Request,
context.RequestAborted));
}
}
else
Expand Down
8 changes: 5 additions & 3 deletions src/NSwag.AspNetCore/ReDocSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

using NSwag.Generation;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading;
#if AspNetOwin
using Microsoft.Owin;

Expand All @@ -30,15 +32,15 @@ public class ReDocSettings : SwaggerUiSettingsBase
public IDictionary<string, object> AdditionalSettings { get; } = new Dictionary<string, object>();

#if AspNetOwin
internal override string TransformHtml(string html, IOwinRequest request)
internal override Task<string> TransformHtmlAsync(string html, IOwinRequest request, CancellationToken cancellationToken)
#else
internal override string TransformHtml(string html, HttpRequest request)
internal override Task<string> TransformHtmlAsync(string html, HttpRequest request, CancellationToken cancellationToken)
#endif
{
html = html.Replace("{AdditionalSettings}", GenerateAdditionalSettings(AdditionalSettings));
html = html.Replace("{CustomStyle}", GetCustomStyleHtml(request));
html = html.Replace("{CustomScript}", GetCustomScriptHtml(request));
return html;
return Task.FromResult(html);
}
}
}
2 changes: 1 addition & 1 deletion src/NSwag.AspNetCore/SwaggerUi3/swagger-ui-bundle.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/NSwag.AspNetCore/SwaggerUi3/swagger-ui-es-bundle.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/NSwag.AspNetCore/SwaggerUi3/swagger-ui.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/NSwag.AspNetCore/SwaggerUi3/swagger-ui.js

Large diffs are not rendered by default.

Loading
Loading