I could not find a way in v14 to configure a custom OpenApiSchemaGenerator like it was possible in v13:
services.AddOpenApiDocument(document => {
document.SchemaGenerator = new MyOpenApiSchemaGenerator(document);
In v14 the OpenApiSchemaGenerator gets created inside the constructor of OpenApiDocumentGenerator:
/// <summary>Provides services to for Swagger generators like the creation of parameters and handling of schemas.</summary>
public class OpenApiDocumentGenerator
{
private readonly JsonSchemaResolver _schemaResolver;
private readonly OpenApiDocumentGeneratorSettings _settings;
/// <summary>Initializes a new instance of the <see cref="OpenApiDocumentGenerator"/> class.</summary>
/// <param name="settings">The settings.</param>
/// <param name="schemaResolver">The schema resolver.</param>
public OpenApiDocumentGenerator(OpenApiDocumentGeneratorSettings settings, JsonSchemaResolver schemaResolver)
{
SchemaGenerator = new OpenApiSchemaGenerator(settings);
...
Would you consider bringing that capability back in? Or would a PR be welcome?
I could not find a way in v14 to configure a custom OpenApiSchemaGenerator like it was possible in v13:
In v14 the OpenApiSchemaGenerator gets created inside the constructor of OpenApiDocumentGenerator:
Would you consider bringing that capability back in? Or would a PR be welcome?