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. koandjqueryare now automatically imported in the generated file (to use old behavior, setImportRequiredTypestofalse)- 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
TemplatefromAngular2toAngular MarkOptionalPropertiesis now by defaulttrue
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 totoJSON()(the originaltoJSON()method has been removed, useJSON.stringify(dto.toJSON())instead) - The
clone()methods in DTOs are not generated by default anymore (addedGenerateCloneMethodsetting)
Breaking changes (WebApiToSwagger generator):
- IDocumentProcessor and ITypeMapper are now async: #684
Changes (TS generator):
- Reduced file size by nearly 20 % when using
undefinedas Null value. - Added support to handle
$ref,$idand$valueswhen deserializing DTOs (circular references). Can be enabled with theHandleReferencessetting (default:false, because more code is generated). - Improved all templates so that you can enable
strictNullChecksin yourtsconfig.json(may still require improvements) - Added
GenerateConstructorInterfacesetting (default: true) for simpler DTO class initialization
Changes (WebApiToSwagger generator):