github RicoSuter/NSwag NSwag-Build-813
NSwag v10.0 (Build 813)

latest releases: v14.2.0, v14.1.0, v14.0.8...
7 years ago

Breaking changes (TS generator):

  • Important: Extended classes (defined in ExtensionCode) are now copied into the generated classes (extension is no longer based on inheritance), see NJS/TypeScriptGenerator for more information. If you use extension code, you probably have to do some minor changes.
  • ko and jquery are now automatically imported in the generated file (to use old behavior, set ImportRequiredTypes to false)
  • Non-JSON results (i.e. images, binary data, etc.) are now streamed and returned as blobs instead of any (except with the JQuery templates, they do not support blob download).
  • Renamed TypeScriptTemplate.Angular2 to Angular: NSwag Documents are automatically migrated, otherwise you have to change the setting Template from Angular2 to Angular
  • MarkOptionalProperties is now by default true

NJsonSchema (DTOs)

  • DTO objects are now initialized with the init() method instead of the constructor. If you rely on that, you have to refactor your code (NJsonSchema change).
  • The toJS() method has been renamed to toJSON() (the original toJSON() method has been removed, use JSON.stringify(dto.toJSON()) instead)
  • The clone() methods in DTOs are not generated by default anymore (added GenerateCloneMethod setting)

Breaking changes (WebApiToSwagger generator):

  • IDocumentProcessor and ITypeMapper are now async: #684

Changes (TS generator):

  • Reduced file size by nearly 20 % when using undefined as Null value.
  • Added support to handle $ref, $id and $values when deserializing DTOs (circular references). Can be enabled with the HandleReferences setting (default: false, because more code is generated).
  • Improved all templates so that you can enable strictNullChecks in your tsconfig.json (may still require improvements)
  • Added GenerateConstructorInterface setting (default: true) for simpler DTO class initialization

Changes (WebApiToSwagger generator):

  • Improved Web API routing handling: 2d8ec06
  • Support for multiple success responses with the same type, #700

Don't miss a new NSwag release

NewReleases is sending notifications on new releases.