diff --git a/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs b/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs index c41f465d2..abbca5a16 100644 --- a/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs +++ b/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using NJsonSchema; using Squidex.Domain.Apps.Core.Schemas; using Squidex.Infrastructure; @@ -14,7 +13,7 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema { public static class JsonSchemaExtensions { - public static JsonSchema4 BuildJsonSchema(this Schema schema, PartitionResolver partitionResolver, Func schemaResolver) + public static JsonSchema4 BuildJsonSchema(this Schema schema, PartitionResolver partitionResolver, SchemaResolver schemaResolver) { Guard.NotNull(schemaResolver, nameof(schemaResolver)); Guard.NotNull(partitionResolver, nameof(partitionResolver)); @@ -27,9 +26,9 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema foreach (var field in schema.Fields.ForApi()) { var partitionObject = Builder.Object(); - var partition = partitionResolver(field.Partitioning); + var partitionSet = partitionResolver(field.Partitioning); - foreach (var partitionItem in partition) + foreach (var partitionItem in partitionSet) { var partitionItemProperty = field.Accept(jsonTypeVisitor); diff --git a/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonTypeVisitor.cs b/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonTypeVisitor.cs index 124b3eaec..cc179cb8c 100644 --- a/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonTypeVisitor.cs +++ b/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonTypeVisitor.cs @@ -5,18 +5,19 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Collections.ObjectModel; using NJsonSchema; using Squidex.Domain.Apps.Core.Schemas; namespace Squidex.Domain.Apps.Core.GenerateJsonSchema { + public delegate JsonSchema4 SchemaResolver(string name, JsonSchema4 schema); + public sealed class JsonTypeVisitor : IFieldVisitor { - private readonly Func schemaResolver; + private readonly SchemaResolver schemaResolver; - public JsonTypeVisitor(Func schemaResolver) + public JsonTypeVisitor(SchemaResolver schemaResolver) { this.schemaResolver = schemaResolver; } diff --git a/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaSwaggerGenerator.cs b/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaSwaggerGenerator.cs index 9a6d904c8..b9703b584 100644 --- a/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaSwaggerGenerator.cs +++ b/src/Squidex/Areas/Api/Controllers/Contents/Generator/SchemaSwaggerGenerator.cs @@ -40,7 +40,13 @@ namespace Squidex.Areas.Api.Controllers.Contents.Generator SchemaQueryDescription = NSwagHelper.LoadDocs("schemaquery"); } - public SchemaSwaggerGenerator(SwaggerDocument document, string appName, string appPath, Schema schema, Func schemaResolver, PartitionResolver partitionResolver) + public SchemaSwaggerGenerator( + SwaggerDocument document, + string appName, + string appPath, + Schema schema, + SchemaResolver schemaResolver, + PartitionResolver partitionResolver) { this.document = document; diff --git a/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerGrainTests.cs b/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerGrainTests.cs index 7814cb6b9..a5e848ec2 100644 --- a/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerGrainTests.cs +++ b/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerGrainTests.cs @@ -115,7 +115,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text } [Fact] - public async Task Should_simulate_content_reversion() + public async Task Should_simulate_content_reversion() { await AddInvariantContent("Hello", "World", false);