Skip to content

Commit e9eb8c4

Browse files
author
pixellos
committed
Merge branch 'master' of https://github.com/domaindrivendev/Swashbuckle.AspNetCore into issue/1920/add-param-example-support
2 parents 31b8320 + 8f363f7 commit e9eb8c4

File tree

45 files changed

+96
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+96
-79
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Once you have an API that can describe itself in Swagger, you've opened the trea
2121

2222
|Swashbuckle Version|ASP.NET Core|Swagger / OpenAPI Spec.|swagger-ui|ReDoc UI|
2323
|----------|----------|----------|----------|----------|
24-
|[master](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/master/README.md)|>= 2.0.0|2.0, 3.0|4.12.0|2.0.0-rc.72|
25-
|[6.4.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v6.4.0)|>= 2.0.0|2.0, 3.0|4.12.0|2.0.0-rc.72|
24+
|[master](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/master/README.md)|>= 2.0.0|2.0, 3.0|4.15.5|2.0.0|
25+
|[6.5.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v6.5.0)|>= 2.0.0|2.0, 3.0|4.15.5|2.0.0|
2626
|[5.6.3](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v5.6.3)|>= 2.0.0|2.0, 3.0|3.32.5|2.0.0-rc.40|
2727
|[4.0.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v4.0.0)|>= 2.0.0, < 3.0.0|2.0|3.19.5|1.22.2|
2828
|[3.0.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v3.0.0)|>= 1.0.4, < 3.0.0|2.0|3.17.1|1.20.0|
@@ -33,8 +33,8 @@ Once you have an API that can describe itself in Swagger, you've opened the trea
3333
1. Install the standard Nuget package into your ASP.NET Core application.
3434

3535
```
36-
Package Manager : Install-Package Swashbuckle.AspNetCore -Version 6.4.0
37-
CLI : dotnet add package --version 6.4.0 Swashbuckle.AspNetCore
36+
Package Manager : Install-Package Swashbuckle.AspNetCore -Version 6.5.0
37+
CLI : dotnet add package --version 6.5.0 Swashbuckle.AspNetCore
3838
```
3939
4040
2. In the `ConfigureServices` method of `Startup.cs`, register the Swagger generator, defining one or more Swagger documents.
@@ -110,8 +110,8 @@ If you're using **System.Text.Json (STJ)**, then the setup described above will
110110
If you're using **Newtonsoft**, then you'll need to install a separate package and explicitly opt-in to ensure that *Newtonsoft* settings/attributes are automatically honored by the Swagger generator:
111111
112112
```
113-
Package Manager : Install-Package Swashbuckle.AspNetCore.Newtonsoft -Version 6.4.0
114-
CLI : dotnet add package --version 6.4.0 Swashbuckle.AspNetCore.Newtonsoft
113+
Package Manager : Install-Package Swashbuckle.AspNetCore.Newtonsoft -Version 6.5.0
114+
CLI : dotnet add package --version 6.5.0 Swashbuckle.AspNetCore.Newtonsoft
115115
```
116116
117117
```csharp
@@ -1549,7 +1549,7 @@ It's packaged as a [.NET Core Tool](https://docs.microsoft.com/en-us/dotnet/core
15491549
1. Install as a [global tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#install-a-global-tool)
15501550
15511551
```
1552-
dotnet tool install -g --version 6.4.0 Swashbuckle.AspNetCore.Cli
1552+
dotnet tool install -g --version 6.5.0 Swashbuckle.AspNetCore.Cli
15531553
```
15541554

15551555
2. Verify that the tool was installed correctly
@@ -1580,7 +1580,7 @@ It's packaged as a [.NET Core Tool](https://docs.microsoft.com/en-us/dotnet/core
15801580
2. Install as a [local tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#install-a-local-tool)
15811581
15821582
```
1583-
dotnet tool install --version 6.4.0 Swashbuckle.AspNetCore.Cli
1583+
dotnet tool install --version 6.5.0 Swashbuckle.AspNetCore.Cli
15841584
```
15851585

15861586
3. Verify that the tool was installed correctly

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ init:
88
- git config --global core.autocrlf true
99

1010
environment:
11-
DOTNET_VERSION: "6.0.100-rc.2.21505.57"
11+
DOTNET_VERSION: "7.0.100"
1212

1313
build_script:
1414
- ps: dotnet pack -c Release -o artifacts

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.100-rc.2.21505.57",
3+
"version": "7.0.100",
44
"rollForward": "latestMajor"
55
}
66
}

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git</RepositoryUrl>
13-
<VersionPrefix>6.4.0</VersionPrefix>
13+
<VersionPrefix>6.5.0</VersionPrefix>
1414
<LangVersion>9</LangVersion>
1515
</PropertyGroup>
1616

src/Swashbuckle.AspNetCore.Annotations/Swashbuckle.AspNetCore.Annotations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NoWarn>$(NoWarn);1591</NoWarn>
88
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore;annotations</PackageTags>
99
<SignAssembly Condition="'$(OS)'=='Windows_NT'">true</SignAssembly>
10-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0</TargetFrameworks>
10+
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0</TargetFrameworks>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle.AspNetCore.ApiTesting.Xunit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<IsTestProject>false</IsTestProject>
77
<NoWarn>$(NoWarn);1591</NoWarn>
88
<PackageTags>swagger;openapi;test-first;spec-first;testing;aspnetcore;xunit</PackageTags>
9-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0</TargetFrameworks>
9+
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0</TargetFrameworks>
1010
</PropertyGroup>
1111

1212
<ItemGroup>

src/Swashbuckle.AspNetCore.ApiTesting/ResponseValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void ValidateContent(
6868
OpenApiDocument openApiDocument,
6969
HttpContent content)
7070
{
71-
if (content == null)
71+
if (content == null || content?.Headers?.ContentLength == 0)
7272
throw new RequestDoesNotMatchSpecException("Expected content is not present");
7373

7474
if (!contentSpecs.TryGetValue(content.Headers.ContentType.MediaType, out OpenApiMediaType mediaTypeSpec))

src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle.AspNetCore.ApiTesting.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<GenerateDocumentationFile>true</GenerateDocumentationFile>
66
<NoWarn>$(NoWarn);1591</NoWarn>
77
<PackageTags>swagger;openapi;test-first;spec-first;testing;aspnetcore</PackageTags>
8-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0</TargetFrameworks>
8+
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0</TargetFrameworks>
99
</PropertyGroup>
1010

1111
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
@@ -24,6 +24,10 @@
2424
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0-rc.1.21452.15" />
2525
</ItemGroup>
2626

27+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
28+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" />
29+
</ItemGroup>
30+
2731
<ItemGroup>
2832
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
2933
<PackageReference Include="Microsoft.OpenApi" Version="1.2.3" />

src/Swashbuckle.AspNetCore.Cli/Swashbuckle.AspNetCore.Cli.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<OutputType>Exe</OutputType>
77
<PackAsTool>true</PackAsTool>
88
<PackageId>Swashbuckle.AspNetCore.Cli</PackageId>
9-
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;net5.0;net6.0</TargetFrameworks>
9+
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;net5.0;net6.0;net7.0</TargetFrameworks>
1010
<ToolCommandName>swagger</ToolCommandName>
1111
</PropertyGroup>
1212

src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftDataContractResolver.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,11 @@ [ typeof(DateTime) ] = Tuple.Create(DataType.String, "date-time"),
207207
[ typeof(DateTimeOffset) ] = Tuple.Create(DataType.String, "date-time"),
208208
[ typeof(Guid) ] = Tuple.Create(DataType.String, "uuid"),
209209
[ typeof(Uri) ] = Tuple.Create(DataType.String, "uri"),
210-
[ typeof(TimeSpan) ] = Tuple.Create(DataType.String, "date-span")
210+
[ typeof(TimeSpan) ] = Tuple.Create(DataType.String, "date-span"),
211+
#if NET6_0_OR_GREATER
212+
[ typeof(DateOnly) ] = Tuple.Create(DataType.String, "date"),
213+
[ typeof(TimeOnly) ] = Tuple.Create(DataType.String, "time")
214+
#endif
211215
};
212216
}
213217
}

0 commit comments

Comments
 (0)