Skip to content

Commit

Permalink
Update NJS and NR
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Dec 9, 2021
1 parent 33011cd commit e7940cd
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 18 deletions.
4 changes: 1 addition & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>

<PropertyGroup>
<VersionPrefix>13.15.1</VersionPrefix>
<VersionPrefix>14.0.0</VersionPrefix>

<Authors>Rico Suter</Authors>
<Copyright>Copyright © Rico Suter, 2021</Copyright>
Expand Down Expand Up @@ -41,5 +40,4 @@
<ItemGroup>
<None Include="..\..\assets\NuGetIcon.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

</Project>
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.6.2" />
<PackageReference Include="NJsonSchema" Version="10.6.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NSwag.Annotations\NSwag.Annotations.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.AssemblyLoader/NSwag.AssemblyLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NJsonSchema" Version="10.6.2" />
<PackageReference Include="NJsonSchema" Version="10.6.3" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.6.2" />
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.6.3" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NJsonSchema.CodeGeneration.TypeScript" Version="10.6.2" />
<PackageReference Include="NJsonSchema.CodeGeneration.TypeScript" Version="10.6.3" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/NSwag.CodeGeneration/NSwag.CodeGeneration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="NJsonSchema" Version="10.6.2" />
<PackageReference Include="NJsonSchema.CodeGeneration" Version="10.6.2" />
<PackageReference Include="NJsonSchema" Version="10.6.3" />
<PackageReference Include="NJsonSchema.CodeGeneration" Version="10.6.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="Microsoft.CSharp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ public bool AllowReferencesWithProperties
set => Settings.AllowReferencesWithProperties = value;
}

[Argument(Name = "UseXmlDocumentation", IsRequired = false, Description = "Read XML Docs files (default: true).")]
public bool UseXmlDocumentation
{
get => Settings.UseXmlDocumentation;
set => Settings.UseXmlDocumentation = value;
}

[Argument(Name = "ResolveExternalXmlDocumentation", IsRequired = false, Description = "Resolve the XML Docs from the NuGet cache or .NET SDK directory (default: true).")]
public bool ResolveExternalXmlDocumentation
{
get => Settings.ResolveExternalXmlDocumentation;
set => Settings.ResolveExternalXmlDocumentation = value;
}

[Argument(Name = "ExcludedTypeNames", IsRequired = false, Description = "The excluded type names (same as JsonSchemaIgnoreAttribute).")]
public string[] ExcludedTypeNames
{
Expand Down
22 changes: 22 additions & 0 deletions src/NSwag.Commands/Commands/Generation/TypesToOpenApiCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,35 @@ public bool GenerateKnownTypes
set { Settings.GenerateKnownTypes = value; }
}

[Argument(Name = "GenerateEnumMappingDescription", IsRequired = false,
Description = "Generate a description with number to enum name mappings (for integer enums only, default: false).")]
public bool GenerateEnumMappingDescription
{
get => Settings.GenerateEnumMappingDescription;
set => Settings.GenerateEnumMappingDescription = value;
}

[Argument(Name = "GenerateXmlObjects", IsRequired = false, Description = "Generate xmlObject representation for definitions (default: false).")]
public bool GenerateXmlObjects
{
get { return Settings.GenerateXmlObjects; }
set { Settings.GenerateXmlObjects = value; }
}

[Argument(Name = "UseXmlDocumentation", IsRequired = false, Description = "Read XML Docs files (default: true).")]
public bool UseXmlDocumentation
{
get => Settings.UseXmlDocumentation;
set => Settings.UseXmlDocumentation = value;
}

[Argument(Name = "ResolveExternalXmlDocumentation", IsRequired = false, Description = "Resolve the XML Docs from the NuGet cache or .NET SDK directory (default: true).")]
public bool ResolveExternalXmlDocumentation
{
get => Settings.ResolveExternalXmlDocumentation;
set => Settings.ResolveExternalXmlDocumentation = value;
}

protected override Task<string> RunIsolatedAsync(AssemblyLoader.AssemblyLoader assemblyLoader)
{
var document = new OpenApiDocument();
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Core.Yaml/NSwag.Core.Yaml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<RootNamespace>NSwag</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NJsonSchema.Yaml" Version="10.6.2" />
<PackageReference Include="NJsonSchema.Yaml" Version="10.6.3" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Core/NSwag.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="NJsonSchema" Version="10.6.2" />
<PackageReference Include="NJsonSchema" Version="10.6.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<Reference Include="Microsoft.CSharp" />
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Demo.Web/NSwag.Demo.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<PackageReference Include="Microsoft.Owin.FileSystems" Version="3.0.1" />
<PackageReference Include="Microsoft.Owin.Host.SystemWeb" Version="3.0.1" />
<PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0" />
<PackageReference Include="NJsonSchema" Version="10.6.2" />
<PackageReference Include="NJsonSchema" Version="10.6.3" />
<PackageReference Include="Owin" Version="1.0.0" />
</ItemGroup>
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Generation/NSwag.Generation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="NJsonSchema" Version="10.6.2" />
<PackageReference Include="NJsonSchema" Version="10.6.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
Expand Down
10 changes: 5 additions & 5 deletions src/NSwagStudio/NSwagStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageReference Include="MyToolkit" Version="2.5.16" />
<PackageReference Include="MyToolkit.Extended" Version="2.5.16" />
<PackageReference Include="Namotion.Reflection" Version="2.0.7" />
<PackageReference Include="Namotion.Reflection" Version="2.0.8" />
<PackageReference Include="NConsole" Version="3.9.6519.30868" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NJsonSchema" Version="10.6.2" />
<PackageReference Include="NJsonSchema.CodeGeneration" Version="10.6.2" />
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.6.2" />
<PackageReference Include="NJsonSchema.CodeGeneration.TypeScript" Version="10.6.2" />
<PackageReference Include="NJsonSchema" Version="10.6.3" />
<PackageReference Include="NJsonSchema.CodeGeneration" Version="10.6.3" />
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.6.3" />
<PackageReference Include="NJsonSchema.CodeGeneration.TypeScript" Version="10.6.3" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.0" />
<PackageReference Include="System.Security.Cryptography.Encoding" Version="4.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@
<TextBlock Text="Use the HttpMethodAttribute Name property as OperationId (if available)." TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Command.UseXmlDocumentation, Mode=TwoWay}" Margin="0,0,0,12" ToolTip="UseXmlDocumentation">
<TextBlock Text="Read XML Docs files." TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Command.ResolveExternalXmlDocumentation, Mode=TwoWay}" Margin="0,0,0,12" ToolTip="ResolveExternalXmlDocumentation">
<TextBlock Text="Resolve the XML Docs from the NuGet cache or .NET SDK directory." TextWrapping="Wrap" />
</CheckBox>

<TextBlock Text="The excluded type names (same as JsonSchemaIgnoreAttribute, comma separated)." FontWeight="Bold" Margin="0,0,0,6" />
<TextBox Text="{Binding Command.ExcludedTypeNames, Mode=TwoWay, Converter={StaticResource StringArrayConverter}, ConverterParameter=','}"
ToolTip="ExcludedTypeNames" Margin="0,0,0,12" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@
<TextBlock Text="Generate xmlObject representation for definitions" TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Command.UseXmlDocumentation, Mode=TwoWay}" Margin="0,0,0,12" ToolTip="UseXmlDocumentation">
<TextBlock Text="Read XML Docs files." TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Command.ResolveExternalXmlDocumentation, Mode=TwoWay}" Margin="0,0,0,12" ToolTip="ResolveExternalXmlDocumentation">
<TextBlock Text="Resolve the XML Docs from the NuGet cache or .NET SDK directory." TextWrapping="Wrap" />
</CheckBox>

<TextBlock Text="Output file path (empty: no file output)" FontWeight="Bold" Margin="0,0,0,6" />
<dialogs:FileSavePicker DefaultExtension=".cs"
Filter="OpenAPI/Swagger Specification JSON (.json)|*.json|Swagger Specification YAML (.yaml)|*.yaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@
<TextBlock Text="Generate xmlObject representation for definitions" TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Command.UseXmlDocumentation, Mode=TwoWay}" Margin="0,0,0,12" ToolTip="UseXmlDocumentation">
<TextBlock Text="Read XML Docs files." TextWrapping="Wrap" />
</CheckBox>

<CheckBox IsChecked="{Binding Command.ResolveExternalXmlDocumentation, Mode=TwoWay}" Margin="0,0,0,12" ToolTip="ResolveExternalXmlDocumentation">
<TextBlock Text="Resolve the XML Docs from the NuGet cache or .NET SDK directory." TextWrapping="Wrap" />
</CheckBox>

<TextBlock Text="Default URL Template" FontWeight="Bold" Margin="0,0,0,6" />
<TextBlock Text="Default for Web API: 'api/{controller}/{id}'; for MVC projects: '{controller}/{action}/{id?}'" TextWrapping="Wrap" Margin="0,0,0,6" />
<TextBox Text="{Binding Command.DefaultUrlTemplate, Mode=TwoWay}"
Expand Down

0 comments on commit e7940cd

Please sign in to comment.