Skip to content

@RicoSuter RicoSuter released this Jun 11, 2019

Breaking changes

Renamed classes:

  • All Swagger* classes have been renamed to OpenApi*
    • E.g. SwaggerDocument renamed to OpenApiDocument
  • JsonSchema4 has been renamed to JsonSchema (NJsonSchema.JsonSchema)
    • JsonProperty renamed to JsonSchemaProperty
  • Renamed AspNetCoreToSwaggerGenerator to AspNetCoreOpenApiDocumentGenerator
  • Renamed WebApiToSwaggerGenerator to WebApiOpenApiDocumentGenerator
  • Renamed attributes/annotations (old ones are still available)
    • E.g. SwaggerOperationAttribute renamed to OpenApiOperationAttribute
  • Moved JsonExceptionConverter from NSwag.Annotations to NJsonSchema package

Renamed packages:

  • Packages NSwag.SwaggerGeneration* renamed to NSwag.Generation*

Renamed commands (old commands are still available):

  • Renamed swagger* commands to openapi*
    • E.g. swagger2csclient renamed to openapi2csclient
  • nswag.json files are automatically converted

Changed interfaces:

  • Some async (Task returning) interface methods have been changed to be sync
    • ISchemaProcessor, IOperationProcessor, IDocumentProcessor
      • From ProcessAsync to Process
    • This was done to improve performance

Removed obsolete methods in the NSwag.AspNetCore package:

  • ASP.NET Core middlewares no longer support the old reflection based generator
    • Removed the NSwag.SwaggerGeneration.WebApi dependency from NSwag.AspNetCore

TypeScript generator:

Changes

API changes:

  • Added automatic reverse proxy (Nginx, IIS) handling, #2196

OpenAPI/Swagger generator:

OpenAPI UIs (Swagger UI 3, ReDoc, etc.):

  • Improve custom css and js path handling, #2099

CSharp client generator:

CSharp controller generator:

  • Added an annotations extension template at controller class level, #2212
  • Add an extendable template above the method of a controller, #2198

NJsonSchema

  • Use Namotion.Reflection for type reflection with big performance improvements
  • DataContractMember(IsRequired) does no longer controll nullability but only whether a JSON property is required
    • [Required] still makes a property non-nullable
  • Add ReferenceTypeNullHandling.Default (supports Nullable Reference Types C# 8)
  • Add CSharpGeneratorSettings.AnyType with default "object", #981
  • Add Interface to JsonSchemaAbstractAttribute, #909
  • Always allow AllowAdditionalProperties on object via settings, #981
Assets 4
You can’t perform that action at this time.