Skip to content
Permalink
Browse files

v13: Renamings and refactorings (#2191)

* Remove unused code

* Rename core

* Rename swagger document

* Rename yaml document

* Rename Swagger to OpenApi in core

* Rename more stuff

* Rename middlewares

* Update attributes

* Add comments

* More renames

* Exclude tests

* Refactor settings

* Move converter

* Remove unused interface

* Rename commands

* Rename commands

* Fix naming

* Regenerate clients

* Rename packages

* Remove unused nuspecs

* Update namespaces

* Fix namespaces

* Rename library

* Fix tests

* Update NJS, make generator sync

* Update NJS

* Add setting

* Save config with legacy transformation before var replacement

* Correctly update ExceptionClass (TS)

* v13.0.0
  • Loading branch information...
RicoSuter committed May 26, 2019
1 parent ed9119b commit 889142b3dc01feb07d13200440d119fa8f7d5944
Showing 417 changed files with 6,038 additions and 5,820 deletions.
@@ -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:
@@ -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
@@ -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>
@@ -1,8 +1,8 @@
{
"runtime": "NetCore20",
"defaultVariables": "configuration=Debug",
"swaggerGenerator": {
"aspNetCoreToSwagger": {
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "Sample.AspNetCore20.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": null,
@@ -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": [],
@@ -28,7 +32,6 @@
"infoTitle": "My Title",
"infoDescription": null,
"infoVersion": "1.0.0",
"includedVersions": null,
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
@@ -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": [],
@@ -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",
@@ -1,8 +1,8 @@
{
"runtime": "Default",
"defaultVariables": "configuration=Debug",
"swaggerGenerator": {
"aspNetCoreToSwagger": {
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": null,
"msBuildProjectExtensionsPath": null,
"configuration": null,
@@ -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": [],
@@ -28,7 +32,6 @@
"infoTitle": "My Title",
"infoDescription": null,
"infoVersion": "1.0.0",
"includedVersions": null,
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
@@ -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": [],
@@ -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",
@@ -1,8 +1,8 @@
{
"runtime": "NetCore21",
"defaultVariables": "configuration=Debug",
"swaggerGenerator": {
"aspNetCoreToSwagger": {
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "Sample.AspNetCore21.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": "",
@@ -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": [],
@@ -28,7 +32,6 @@
"infoTitle": "My Title",
"infoDescription": null,
"infoVersion": "1.0.0",
"includedVersions": null,
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
@@ -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": [],
@@ -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",
@@ -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": {}
@@ -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",
@@ -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>
@@ -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>

This file was deleted.

@@ -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>
@@ -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
{
}

0 comments on commit 889142b

Please sign in to comment.
You can’t perform that action at this time.