Skip to content

Commit

Permalink
Add xml-comments to nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
Chebotov Nikolay committed Feb 20, 2020
1 parent bcbb2ff commit cc21b52
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

These are the changes to each version that has been released on the [nuget](https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions/).

## v2.1.2 `(2020-02-20)`

- [x] Add xml-comments to nuget package

## v2.1.1 `(2020-02-19)`

- [x] Fix bug: use `System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping` encoder for responses examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
case ResponseExampleOptions.AddNew:
if (this._responseExample != null)
{
jsonContent.Example = new OpenApiString(System.Text.Json.JsonSerializer.Serialize(this._responseExample,
var jsonExample = new OpenApiString(System.Text.Json.JsonSerializer.Serialize(this._responseExample,
new System.Text.Json.JsonSerializerOptions
{
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
}));

jsonContent.Example = jsonExample;
}
jsonContent.Schema = schema;
break;
Expand All @@ -114,14 +116,15 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
case ResponseExampleOptions.AddNew:
if (this._responseExample != null)
{
var jsonExample = new OpenApiString(System.Text.Json.JsonSerializer.Serialize(this._responseExample,
new System.Text.Json.JsonSerializerOptions
{
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
}));
response.Value.Content.Add("application/json", new OpenApiMediaType()
{
Example = new OpenApiString(System.Text.Json.JsonSerializer.Serialize(this._responseExample,
new System.Text.Json.JsonSerializerOptions
{
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
})),
Example = jsonExample,
Schema = schema
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
<NeutralLanguage></NeutralLanguage>
<LangVersion>7.3</LangVersion>
<PackageIconUrl>https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/blob/master/assets/icon.png?raw=true</PackageIconUrl>
<Version>2.1.0</Version>
<Version>2.1.2</Version>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>Unchase.Swashbuckle.AspNetCore.Extensions.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.0.0" />
</ItemGroup>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc21b52

Please sign in to comment.