Breaking changes
Renamed classes:
- All
Swagger*
classes have been renamed toOpenApi*
- E.g.
SwaggerDocument
renamed toOpenApiDocument
- E.g.
JsonSchema4
has been renamed toJsonSchema
(NJsonSchema.JsonSchema)JsonProperty
renamed toJsonSchemaProperty
- Renamed
AspNetCoreToSwaggerGenerator
toAspNetCoreOpenApiDocumentGenerator
- Renamed
WebApiToSwaggerGenerator
toWebApiOpenApiDocumentGenerator
- Renamed attributes/annotations (old ones are still available)
- E.g.
SwaggerOperationAttribute
renamed toOpenApiOperationAttribute
- E.g.
- Moved
JsonExceptionConverter
fromNSwag.Annotations
toNJsonSchema
package
Renamed packages:
- Packages
NSwag.SwaggerGeneration*
renamed toNSwag.Generation*
Renamed commands (old commands are still available):
- Renamed
swagger*
commands toopenapi*
- E.g.
swagger2csclient
renamed toopenapi2csclient
- E.g.
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
toProcess
- From
- 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 fromNSwag.AspNetCore
- Removed the
TypeScript generator:
- TS injection and getBaseUrl() fixes, #2204
- Use Array.isArray instead constructor, RicoSuter/NJsonSchema@7c24caa
- Fix TypeScript DTO generation order, closes RicoSuter/NJsonSchema#975
Changes
API changes:
- Added automatic reverse proxy (Nginx, IIS) handling, #2196
OpenAPI/Swagger generator:
- Generate annotations into the paramater schema in OpenAPI 3, 14f264b
- Improve allow additional properties in Swagger 2 (it cannot be a boolean and default is different than in OpenAPI 3)
- Add support for Nullable Reference Types (C# 8), see https://github.com/RicoSuter/Namotion.Reflection#nullability-reflection-c-8
OpenAPI UIs (Swagger UI 3, ReDoc, etc.):
- Improve custom css and js path handling, #2099
CSharp client generator:
- Added two new extension points for Client.Class.liquid, #2207
- Add CSharpGeneratorSettings.AnyType with default "object", RicoSuter/NJsonSchema#981
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