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
andjquery
are now automatically imported in the generated file (to use old behavior, setImportRequiredTypes
tofalse
)- 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
fromAngular2
toAngular
MarkOptionalProperties
is 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 (addedGenerateCloneMethod
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 theHandleReferences
setting (default:false
, because more code is generated). - Improved all templates so that you can enable
strictNullChecks
in yourtsconfig.json
(may still require improvements) - Added
GenerateConstructorInterface
setting (default: true) for simpler DTO class initialization
Changes (WebApiToSwagger generator):