-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #708 from NSwag/master
Release v10.0
- Loading branch information
Showing
171 changed files
with
10,444 additions
and
8,063 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Release v10 Announcement | ||
|
||
**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](https://github.com/NJsonSchema/NJsonSchema/wiki/TypeScriptGenerator#extended-classes-and-extension-code) 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: https://github.com/NSwag/NSwag/issues/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: https://github.com/NSwag/NSwag/commit/2d8ec0629e302947cafdf776717d48e21d2dc736 | ||
- Support for multiple success responses with the same type, https://github.com/NSwag/NSwag/issues/700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
namespace NSwag.Annotations | ||
//----------------------------------------------------------------------- | ||
// <copyright file="WillReadBodyAttribute.cs" company="NSwag"> | ||
// Copyright (c) Rico Suter. All rights reserved. | ||
// </copyright> | ||
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license> | ||
// <author>Rico Suter, [email protected]</author> | ||
//----------------------------------------------------------------------- | ||
|
||
namespace NSwag.Annotations | ||
{ | ||
using System; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.