RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.78k stars 1.29k forks source link

Keep v14 OpenApiDocumentGeneratorSettings retro-compatibility with v13 #4648

Open paulomorgado opened 10 months ago

paulomorgado commented 10 months ago

This breaking change introduced in v14 is a binary breaking change that forces all components using this to be upgraded.

I see 2 issues here:

A nice to have obsolescence plan would be to:

Note: I haven't evaluated the feasibility of keeping the JsonSchemaGeneratorSettings base class.

RicoSuter commented 10 months ago

This doesnt work because now there is not only one JsonSchemaGeneratorSettings but two:

The NewtonsoftJsonJsonSchemaGeneratorSettings and SystemTextJsonJsonSchemaGeneratorSettings which both inherit from JsonSchemaGeneratorSettings... this is why there is this breaking change anyway, and also why this is part of the major version change...

there are quite a few other breaking changes also in NJS that in the end backward compat will not be available anyway.

paulomorgado commented 10 months ago

I saw that.

The main issue here is that JsonSchemaGeneratorSettings's members are not virtual and there's no way proxying them.

Since this is not possible, it's, probably, too much effort to keep source compatibility when binary compatibility is not possible.

On the other hand, it would guide the user on how to change the source code.