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

v13: Renamings and refactorings #2191

Merged
merged 30 commits into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
46a00ce
Remove unused code
RicoSuter May 24, 2019
15c8043
Rename core
RicoSuter May 24, 2019
958737e
Rename swagger document
RicoSuter May 24, 2019
530aaf7
Rename yaml document
RicoSuter May 24, 2019
e8c85f7
Rename Swagger to OpenApi in core
RicoSuter May 25, 2019
19eb532
Rename more stuff
RicoSuter May 25, 2019
fd5de19
Rename middlewares
RicoSuter May 25, 2019
1345ede
Update attributes
RicoSuter May 25, 2019
00208cd
Add comments
RicoSuter May 25, 2019
7254fa9
More renames
RicoSuter May 25, 2019
f3a9539
Exclude tests
RicoSuter May 25, 2019
5772664
Refactor settings
RicoSuter May 25, 2019
ba9f29b
Move converter
RicoSuter May 25, 2019
6adbf84
Remove unused interface
RicoSuter May 25, 2019
828753a
Rename commands
RicoSuter May 25, 2019
1a8ab6d
Rename commands
RicoSuter May 25, 2019
a9ff61a
Fix naming
RicoSuter May 25, 2019
3466901
Regenerate clients
RicoSuter May 25, 2019
a2ab9d8
Rename packages
RicoSuter May 25, 2019
d7ad5a9
Remove unused nuspecs
RicoSuter May 25, 2019
6d63c73
Update namespaces
RicoSuter May 25, 2019
e8d8ed1
Fix namespaces
RicoSuter May 25, 2019
39d1ac1
Rename library
RicoSuter May 25, 2019
9cf7d61
Fix tests
RicoSuter May 25, 2019
0d0ab92
Update NJS, make generator sync
RicoSuter May 26, 2019
dea2422
Update NJS
RicoSuter May 26, 2019
c65466f
Add setting
RicoSuter May 26, 2019
2e9bfa8
Save config with legacy transformation before var replacement
RicoSuter May 26, 2019
869ffc1
Correctly update ExceptionClass (TS)
RicoSuter May 26, 2019
94b15c5
v13.0.0
RicoSuter May 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ Specification:

Swagger generation:

- **[NSwag.SwaggerGeneration](https://www.nuget.org/packages/NSwag.SwaggerGeneration/)** (.NET Standard 1.0 / 2.0 and .NET 4.5):
- **[NSwag.Generation](https://www.nuget.org/packages/NSwag.Generation/)** (.NET Standard 1.0 / 2.0 and .NET 4.5):
- Classes to generate Swagger specifications
- **[NSwag.SwaggerGeneration.WebApi](https://www.nuget.org/packages/NSwag.SwaggerGeneration.WebApi/)** (.NET Standard 1.0 / 2.0 and .NET 4.5):
- **[NSwag.Generation.WebApi](https://www.nuget.org/packages/NSwag.Generation.WebApi/)** (.NET Standard 1.0 / 2.0 and .NET 4.5):
- Classes to generate Swagger specifications from Web API controllers, see [WebApiToSwaggerGenerator](https://github.com/RSuter/NSwag/wiki/WebApiToSwaggerGenerator)
- **[NSwag.SwaggerGeneration.AspNetCore](https://www.nuget.org/packages/NSwag.SwaggerGeneration.AspNetCore/)** (.NET Standard 1.6 / 2.0 and .NET 4.5.1):
- **[NSwag.Generation.AspNetCore](https://www.nuget.org/packages/NSwag.Generation.AspNetCore/)** (.NET Standard 1.6 / 2.0 and .NET 4.5.1):
- (Experimental) Classes to generate Swagger specifications from ASP.NET Core MVC controllers using the ApiExplorer

Code generation:
Expand Down
6 changes: 3 additions & 3 deletions build/02_RunUnitTests.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
vstest.console /logger:Appveyor "%~dp0../src/NSwag.SwaggerGeneration.WebApi.Tests/bin/Release/NSwag.SwaggerGeneration.WebApi.Tests.dll" || goto :error
vstest.console /logger:Appveyor "%~dp0../src/NSwag.Tests/bin/Release/NSwag.Tests.dll" || goto :error
vstest.console /logger:Appveyor "%~dp0../src/NSwag.Generation.WebApi.Tests/bin/Release/NSwag.Generation.WebApi.Tests.dll" || goto :error
REM vstest.console /logger:Appveyor "%~dp0../src/NSwag.Tests/bin/Release/NSwag.Tests.dll" || goto :error

dotnet test "%~dp0/../src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj" -c Release || goto :error
dotnet test "%~dp0/../src/NSwag.CodeGeneration.CSharp.Tests/NSwag.CodeGeneration.CSharp.Tests.csproj" -c Release || goto :error
dotnet test "%~dp0/../src/NSwag.CodeGeneration.TypeScript.Tests/NSwag.CodeGeneration.TypeScript.Tests.csproj" -c Release || goto :error
dotnet test "%~dp0/../src/NSwag.SwaggerGeneration.AspNetCore.Tests/NSwag.SwaggerGeneration.AspNetCore.Tests.csproj" -c Release || goto :error
dotnet test "%~dp0/../src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj" -c Release || goto :error
dotnet test "%~dp0/../src/NSwag.Core.Tests/NSwag.Core.Tests.csproj" -c Release || goto :error
dotnet test "%~dp0/../src/NSwag.Core.Yaml.Tests/NSwag.Core.Yaml.Tests.csproj" -c Release || goto :error
dotnet test "%~dp0/../src/NSwag.AssemblyLoader.Tests/NSwag.AssemblyLoader.Tests.csproj" -c Release -f netcoreapp2.1 || goto :error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
<Reference Include="NSwag.Core, Version=12.0.13.0, Culture=neutral, PublicKeyToken=c2d88086e098d109, processorArchitecture=MSIL">
<HintPath>..\packages\NSwag.Core.12.0.13\lib\net45\NSwag.Core.dll</HintPath>
</Reference>
<Reference Include="NSwag.SwaggerGeneration, Version=12.0.13.0, Culture=neutral, PublicKeyToken=c2d88086e098d109, processorArchitecture=MSIL">
<HintPath>..\packages\NSwag.SwaggerGeneration.12.0.13\lib\net45\NSwag.SwaggerGeneration.dll</HintPath>
<Reference Include="NSwag.Generation, Version=12.0.13.0, Culture=neutral, PublicKeyToken=c2d88086e098d109, processorArchitecture=MSIL">
<HintPath>..\packages\NSwag.Generation.12.0.13\lib\net45\NSwag.Generation.dll</HintPath>
</Reference>
<Reference Include="NSwag.SwaggerGeneration.WebApi, Version=12.0.13.0, Culture=neutral, PublicKeyToken=c2d88086e098d109, processorArchitecture=MSIL">
<HintPath>..\packages\NSwag.SwaggerGeneration.WebApi.12.0.13\lib\net45\NSwag.SwaggerGeneration.WebApi.dll</HintPath>
<Reference Include="NSwag.Generation.WebApi, Version=12.0.13.0, Culture=neutral, PublicKeyToken=c2d88086e098d109, processorArchitecture=MSIL">
<HintPath>..\packages\NSwag.Generation.WebApi.12.0.13\lib\net45\NSwag.Generation.WebApi.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
Expand Down
13 changes: 10 additions & 3 deletions samples/WithoutMiddleware/Sample.AspNetCore20/nswag_project.nswag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"runtime": "NetCore20",
"defaultVariables": "configuration=Debug",
"swaggerGenerator": {
"aspNetCoreToSwagger": {
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "Sample.AspNetCore20.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": null,
Expand All @@ -12,13 +12,17 @@
"verbose": true,
"workingDirectory": null,
"requireParametersWithoutDefault": true,
"apiGroupNames": null,
"defaultPropertyNameHandling": "Default",
"defaultReferenceTypeNullHandling": "Null",
"defaultResponseReferenceTypeNullHandling": "Null",
"defaultEnumHandling": "Integer",
"flattenInheritanceHierarchy": false,
"generateKnownTypes": true,
"generateEnumMappingDescription": false,
"generateXmlObjects": false,
"generateAbstractProperties": false,
"generateAbstractSchemas": true,
"ignoreObsoleteProperties": false,
"allowReferencesWithProperties": false,
"excludedTypeNames": [],
Expand All @@ -28,7 +32,6 @@
"infoTitle": "My Title",
"infoDescription": null,
"infoVersion": "1.0.0",
"includedVersions": null,
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
Expand All @@ -37,7 +40,11 @@
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": false,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
"startupType": null,
"allowNullableBodyParameters": true,
"output": "nswag_project_swagger.json",
"outputType": "Swagger2",
"assemblyPaths": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.3.1.0 (NJsonSchema v9.14.1.0 (Newtonsoft.Json v10.0.0.0))",
"x-generator": "NSwag v13.0.0.0 (NJsonSchema v10.0.6.0 (Newtonsoft.Json v10.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
15 changes: 11 additions & 4 deletions samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly.nswag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"runtime": "Default",
"defaultVariables": "configuration=Debug",
"swaggerGenerator": {
"aspNetCoreToSwagger": {
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": null,
"msBuildProjectExtensionsPath": null,
"configuration": null,
Expand All @@ -12,13 +12,17 @@
"verbose": false,
"workingDirectory": null,
"requireParametersWithoutDefault": true,
"apiGroupNames": null,
"defaultPropertyNameHandling": "Default",
"defaultReferenceTypeNullHandling": "Null",
"defaultResponseReferenceTypeNullHandling": "Null",
"defaultEnumHandling": "Integer",
"flattenInheritanceHierarchy": false,
"generateKnownTypes": true,
"generateEnumMappingDescription": false,
"generateXmlObjects": false,
"generateAbstractProperties": false,
"generateAbstractSchemas": true,
"ignoreObsoleteProperties": false,
"allowReferencesWithProperties": false,
"excludedTypeNames": [],
Expand All @@ -28,7 +32,6 @@
"infoTitle": "My Title",
"infoDescription": null,
"infoVersion": "1.0.0",
"includedVersions": null,
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
Expand All @@ -37,11 +40,15 @@
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": false,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
"startupType": null,
"allowNullableBodyParameters": true,
"output": "nswag_assembly_swagger.json",
"outputType": "Swagger2",
"assemblyPaths": [
"bin/$(configuration)/netcoreapp2.1/Sample.AspNetCore21.dll"
"bin/Release/netcoreapp2.1/Sample.AspNetCore21.dll"
],
"assemblyConfig": null,
"referencePaths": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.3.1.0 (NJsonSchema v9.14.1.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v13.0.0.0 (NJsonSchema v10.0.6.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
13 changes: 10 additions & 3 deletions samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project.nswag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"runtime": "NetCore21",
"defaultVariables": "configuration=Debug",
"swaggerGenerator": {
"aspNetCoreToSwagger": {
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "Sample.AspNetCore21.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": "",
Expand All @@ -12,13 +12,17 @@
"verbose": false,
"workingDirectory": null,
"requireParametersWithoutDefault": true,
"apiGroupNames": null,
"defaultPropertyNameHandling": "Default",
"defaultReferenceTypeNullHandling": "Null",
"defaultResponseReferenceTypeNullHandling": "Null",
"defaultEnumHandling": "Integer",
"flattenInheritanceHierarchy": false,
"generateKnownTypes": true,
"generateEnumMappingDescription": false,
"generateXmlObjects": false,
"generateAbstractProperties": false,
"generateAbstractSchemas": true,
"ignoreObsoleteProperties": false,
"allowReferencesWithProperties": false,
"excludedTypeNames": [],
Expand All @@ -28,7 +32,6 @@
"infoTitle": "My Title",
"infoDescription": null,
"infoVersion": "1.0.0",
"includedVersions": null,
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
Expand All @@ -37,7 +40,11 @@
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": false,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
"startupType": null,
"allowNullableBodyParameters": true,
"output": "nswag_project_swagger.json",
"outputType": "Swagger2",
"assemblyPaths": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.3.1.0 (NJsonSchema v9.14.1.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v13.0.0.0 (NJsonSchema v10.0.6.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,54 @@
{
"runtime": "Default",
"defaultVariables": "configuration=Debug",
"swaggerGenerator": {
"webApiToSwagger": {
"documentGenerator": {
"webApiToOpenApi": {
"controllerNames": [],
"isAspNetCore": true,
"resolveJsonOptions": false,
"defaultUrlTemplate": "api/{controller}/{id?}",
"addMissingPathParameters": false,
"includedVersions": null,
"defaultPropertyNameHandling": "Default",
"defaultReferenceTypeNullHandling": "Null",
"defaultResponseReferenceTypeNullHandling": "Null",
"defaultEnumHandling": "Integer",
"flattenInheritanceHierarchy": false,
"generateKnownTypes": true,
"generateEnumMappingDescription": false,
"generateXmlObjects": false,
"generateAbstractProperties": false,
"generateAbstractSchemas": true,
"ignoreObsoleteProperties": false,
"allowReferencesWithProperties": false,
"excludedTypeNames": [],
"serviceHost": null,
"serviceBasePath": null,
"serviceSchemes": [],
"infoTitle": "My Title",
"infoDescription": null,
"infoVersion": "1.0.0",
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
"typeNameGeneratorType": null,
"schemaNameGeneratorType": null,
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": true,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
"startupType": null,
"allowNullableBodyParameters": true,
"output": "nswag_reflection_swagger.json",
"outputType": "Swagger2",
"assemblyPaths": [
"bin/$(configuration)/netcoreapp2.1/Sample.AspNetCore21.dll"
"bin/Release/netcoreapp2.1/Sample.AspNetCore21.dll"
],
"referencePaths": []
"assemblyConfig": null,
"referencePaths": [],
"useNuGetCache": false
}
},
"codeGenerators": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.3.1.0 (NJsonSchema v9.14.1.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v13.0.0.0 (NJsonSchema v10.0.6.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
5 changes: 1 addition & 4 deletions src/NSwag.Annotations/NSwag.Annotations.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.0;net45;netstandard2.0</TargetFrameworks>
<Description>NSwag: The Swagger API toolchain for .NET and TypeScript</Description>
<Version>12.3.1</Version>
<Version>13.0.0</Version>
<PackageTags>Swagger Documentation WebApi AspNet TypeScript CodeGen</PackageTags>
<Copyright>Copyright © Rico Suter, 2019</Copyright>
<PackageLicenseUrl>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</PackageLicenseUrl>
Expand All @@ -20,9 +20,6 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
28 changes: 0 additions & 28 deletions src/NSwag.Annotations/NSwag.Annotations.nuspec

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,24 @@ namespace NSwag.Annotations
{
/// <summary>Indicates extension data to be added to the Swagger definition.</summary>
/// <remarks>Requires the SwaggerExtensionDataOperationProcessor to be used in the Swagger definition generation.</remarks>
/// <seealso cref="System.Attribute" />
/// <seealso cref="Attribute" />
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Parameter, AllowMultiple = true)]
public sealed class SwaggerExtensionDataAttribute : Attribute
public sealed class OpenApiExtensionDataAttribute : SwaggerExtensionDataAttribute
{
/// <summary>Initializes a new instance of the <see cref="SwaggerExtensionDataAttribute"/> class.</summary>
/// <param name="key">The key.</param>
/// <param name="value">The value.</param>
public OpenApiExtensionDataAttribute(string key, string value) : base(key, value)
{
}
}

/// <summary>Indicates extension data to be added to the Swagger definition.</summary>
/// <remarks>Requires the SwaggerExtensionDataOperationProcessor to be used in the Swagger definition generation.</remarks>
/// <seealso cref="Attribute" />
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Parameter, AllowMultiple = true)]
[Obsolete("Use " + nameof(OpenApiExtensionDataAttribute) + " instead.")]
public class SwaggerExtensionDataAttribute : Attribute
{
/// <summary>Initializes a new instance of the <see cref="SwaggerExtensionDataAttribute"/> class.</summary>
/// <param name="key">The key.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ namespace NSwag.Annotations
{
/// <summary>Specifies a parameter or class to be handled as file.</summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter)]
public class OpenApiFileAttribute : SwaggerFileAttribute
{
}

/// <summary>Specifies a parameter or class to be handled as file.</summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter)]
[Obsolete("Use " + nameof(OpenApiFileAttribute) + " instead.")]
public class SwaggerFileAttribute : Attribute
{
}
Expand Down
Loading