Browse Source

Nullable fix.

pull/566/head
Sebastian 5 years ago
parent
commit
bc06171505
  1. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs
  2. 8
      backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonTypeVisitor.cs
  3. 14
      backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/SchemaBuilder.cs
  4. 1
      backend/src/Squidex.Domain.Apps.Entities/Apps/AppHistoryEventsCreator.cs
  5. 1
      backend/src/Squidex.Domain.Apps.Entities/Assets/AssetHistoryEventsCreator.cs
  6. 1
      backend/src/Squidex.Domain.Apps.Entities/Contents/ContentHistoryEventsCreator.cs
  7. 1
      backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemaHistoryEventsCreator.cs
  8. 1
      backend/src/Squidex.Web/Pipeline/ApiCostsFilter.cs
  9. 7
      backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs
  10. 1
      backend/src/Squidex/Areas/Api/Controllers/Statistics/Models/CallsUsageDtoDto.cs

2
backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonSchemaExtensions.cs

@ -69,7 +69,7 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
jsonProperty.Description = field.Name;
}
jsonProperty.IsRequired = field.RawProperties.IsRequired;
jsonProperty.SetRequired(field.RawProperties.IsRequired);
return jsonProperty;
}

8
backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/JsonTypeVisitor.cs

@ -69,20 +69,16 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
geolocationSchema.Properties.Add("latitude", new JsonSchemaProperty
{
Type = JsonObjectType.Number,
IsNullableRaw = false,
IsRequired = true,
Maximum = 90,
Minimum = -90
});
}.SetRequired(true));
geolocationSchema.Properties.Add("longitude", new JsonSchemaProperty
{
Type = JsonObjectType.Number,
IsNullableRaw = false,
IsRequired = true,
Maximum = 180,
Minimum = -180
});
}.SetRequired(true));
var reference = schemaResolver("GeolocationDto", geolocationSchema);

14
backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/SchemaBuilder.cs

@ -74,16 +74,12 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
return property;
}
public static void SetRequired(this JsonSchemaProperty property, bool isRequired)
public static JsonSchemaProperty SetRequired(this JsonSchemaProperty property, bool isRequired)
{
if (isRequired)
{
property.IsRequired = true;
}
else
{
property.IsNullableRaw = true;
}
property.IsRequired = isRequired;
property.IsNullableRaw = !isRequired;
return property;
}
}
}

1
backend/src/Squidex.Domain.Apps.Entities/Apps/AppHistoryEventsCreator.cs

@ -12,7 +12,6 @@ using Squidex.Domain.Apps.Events.Apps;
using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.Translations;
namespace Squidex.Domain.Apps.Entities.Apps
{

1
backend/src/Squidex.Domain.Apps.Entities/Assets/AssetHistoryEventsCreator.cs

@ -10,7 +10,6 @@ using Squidex.Domain.Apps.Entities.History;
using Squidex.Domain.Apps.Events.Assets;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.Translations;
namespace Squidex.Domain.Apps.Entities.Assets
{

1
backend/src/Squidex.Domain.Apps.Entities/Contents/ContentHistoryEventsCreator.cs

@ -11,7 +11,6 @@ using Squidex.Domain.Apps.Events;
using Squidex.Domain.Apps.Events.Contents;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.Translations;
namespace Squidex.Domain.Apps.Entities.Contents
{

1
backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemaHistoryEventsCreator.cs

@ -11,7 +11,6 @@ using Squidex.Domain.Apps.Events;
using Squidex.Domain.Apps.Events.Schemas;
using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.Translations;
namespace Squidex.Domain.Apps.Entities.Schemas
{

1
backend/src/Squidex.Web/Pipeline/ApiCostsFilter.cs

@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Mvc.Filters;
using Squidex.Domain.Apps.Entities.Apps.Plans;
using Squidex.Infrastructure;
using Squidex.Infrastructure.Log;
using Squidex.Infrastructure.Security;
namespace Squidex.Web.Pipeline
{

7
backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs

@ -11,6 +11,7 @@ using Namotion.Reflection;
using NJsonSchema;
using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
using Squidex.Domain.Apps.Core.GenerateJsonSchema;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure;
@ -43,10 +44,8 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models
schema.Properties["actionType"] = new JsonSchemaProperty
{
Type = JsonObjectType.String,
IsRequired = true,
IsNullableRaw = null
};
Type = JsonObjectType.String
}.SetRequired(true);
foreach (var (key, value) in ruleRegistry.Actions)
{

1
backend/src/Squidex/Areas/Api/Controllers/Statistics/Models/CallsUsageDtoDto.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;

Loading…
Cancel
Save