|
|
|
@ -50,7 +50,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent |
|
|
|
|
|
|
|
public (object? Result, JsonError? Error) Visit(IField<BooleanFieldProperties> field) |
|
|
|
{ |
|
|
|
if (value is JsonScalar<bool> b) |
|
|
|
if (value is JsonBoolean b) |
|
|
|
{ |
|
|
|
return (b.Value, null); |
|
|
|
} |
|
|
|
@ -60,7 +60,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent |
|
|
|
|
|
|
|
public (object? Result, JsonError? Error) Visit(IField<NumberFieldProperties> field) |
|
|
|
{ |
|
|
|
if (value is JsonScalar<double> n) |
|
|
|
if (value is JsonNumber n) |
|
|
|
{ |
|
|
|
return (n.Value, null); |
|
|
|
} |
|
|
|
@ -70,7 +70,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent |
|
|
|
|
|
|
|
public (object? Result, JsonError? Error) Visit(IField<StringFieldProperties> field) |
|
|
|
{ |
|
|
|
if (value is JsonScalar<string> s) |
|
|
|
if (value is JsonString s) |
|
|
|
{ |
|
|
|
return (s.Value, null); |
|
|
|
} |
|
|
|
@ -113,7 +113,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (geolocation.TryGetValue("latitude", out var latValue) && latValue is JsonScalar<double> latNumber) |
|
|
|
if (geolocation.TryGetValue("latitude", out var latValue) && latValue is JsonNumber latNumber) |
|
|
|
{ |
|
|
|
var lat = latNumber.Value; |
|
|
|
|
|
|
|
@ -127,7 +127,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent |
|
|
|
return (null, new JsonError("Invalid json type, expected latitude/longitude object.")); |
|
|
|
} |
|
|
|
|
|
|
|
if (geolocation.TryGetValue("longitude", out var lonValue) && lonValue is JsonScalar<double> lonNumber) |
|
|
|
if (geolocation.TryGetValue("longitude", out var lonValue) && lonValue is JsonNumber lonNumber) |
|
|
|
{ |
|
|
|
var lon = lonNumber.Value; |
|
|
|
|
|
|
|
@ -160,7 +160,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent |
|
|
|
|
|
|
|
foreach (var item in array) |
|
|
|
{ |
|
|
|
if (item is JsonScalar<string> s && Guid.TryParse(s.Value, out var guid)) |
|
|
|
if (item is JsonString s && Guid.TryParse(s.Value, out var guid)) |
|
|
|
{ |
|
|
|
result.Add(guid); |
|
|
|
} |
|
|
|
@ -188,7 +188,7 @@ namespace Squidex.Domain.Apps.Core.ValidateContent |
|
|
|
{ |
|
|
|
result.Add(null); |
|
|
|
} |
|
|
|
else if (item is JsonScalar<string> s) |
|
|
|
else if (item is JsonString s) |
|
|
|
{ |
|
|
|
result.Add(s.Value); |
|
|
|
} |
|
|
|
|