Skip to content

Commit

Permalink
Fix OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Apr 24, 2024
1 parent 3a17ade commit 2e1a848
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -6,6 +6,7 @@
// ==========================================================================

using System.Text.Json;
using Microsoft.Extensions.DependencyInjection;
using NJsonSchema;
using NJsonSchema.Generation;
using NJsonSchema.Generation.TypeMappers;
Expand Down Expand Up @@ -67,6 +68,9 @@ public static void AddSquidexOpenApiSettings(this IServiceCollection services)
var settings = new OpenApiDocumentGeneratorSettings
{
SchemaSettings = new SystemTextJsonSchemaGeneratorSettings()
{
SerializerOptions = c.GetRequiredService<JsonSerializerOptions>()
}
};
ConfigureSchemaSettings(settings.SchemaSettings, c.GetRequiredService<TypeRegistry>(), true);
Expand Down Expand Up @@ -114,6 +118,7 @@ private static void ConfigureSchemaSettings(JsonSchemaGeneratorSettings settings
CreateStringMap<NamedId<DomainId>>(),
CreateStringMap<NamedId<Guid>>(),
CreateStringMap<NamedId<string>>(),
CreateStringMap<PropertyPath>(),
CreateStringMap<RefToken>(),
CreateStringMap<Status>(),
};
Expand Down

0 comments on commit 2e1a848

Please sign in to comment.