diff --git a/Directory.Packages.props b/Directory.Packages.props
index d86ca569..3088b120 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -13,7 +13,7 @@
-
+
@@ -29,9 +29,10 @@
+
-
+
\ No newline at end of file
diff --git a/src/Speckle.Objects/GIS/GisPointFeature.cs b/src/Speckle.Objects/GIS/GisPointFeature.cs
index 57493268..33327083 100644
--- a/src/Speckle.Objects/GIS/GisPointFeature.cs
+++ b/src/Speckle.Objects/GIS/GisPointFeature.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Geometry;
using Speckle.Sdk.Models;
@@ -9,7 +8,8 @@ public class GisPointFeature : Base, IGisFeature, IDisplayValue>
{
public required Base attributes { get; set; }
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List geometry
{
get => displayValue;
diff --git a/src/Speckle.Objects/GIS/GisPolylineFeature.cs b/src/Speckle.Objects/GIS/GisPolylineFeature.cs
index 2f4b578d..e8b0cb63 100644
--- a/src/Speckle.Objects/GIS/GisPolylineFeature.cs
+++ b/src/Speckle.Objects/GIS/GisPolylineFeature.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Geometry;
using Speckle.Sdk.Models;
@@ -9,7 +8,8 @@ public class GisPolylineFeature : Base, IGisFeature, IDisplayValue geometry
{
get => displayValue;
diff --git a/src/Speckle.Objects/Geometry/Arc.cs b/src/Speckle.Objects/Geometry/Arc.cs
index 2add9143..ae8b1a1b 100644
--- a/src/Speckle.Objects/Geometry/Arc.cs
+++ b/src/Speckle.Objects/Geometry/Arc.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Other;
using Speckle.Objects.Primitive;
using Speckle.Sdk.Common;
@@ -42,19 +41,25 @@ public class Arc : Base, IHasBoundingBox, ICurve, ITransformable
///
/// OBSOLETE - This is just here for backwards compatibility.
///
- [JsonIgnore, Obsolete("start angle should be calculated from arc startpoint and plane if needed", true)]
+ [Obsolete("start angle should be calculated from arc startpoint and plane if needed", true)]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public double? startAngle { get; set; }
///
/// OBSOLETE - This is just here for backwards compatibility.
///
- [JsonIgnore, Obsolete("end angle should be calculated from arc endpoint and plane if needed", true)]
+ [Obsolete("end angle should be calculated from arc endpoint and plane if needed", true)]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public double? endAngle { get; set; }
///
/// OBSOLETE - This is just here for backwards compatibility.
///
- [JsonIgnore, Obsolete("Refer to measure instead", true)]
+ [Obsolete("Refer to measure instead", true)]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public double angleRadians { get; set; }
///
@@ -81,7 +86,9 @@ public class Arc : Base, IHasBoundingBox, ICurve, ITransformable
///
/// OBSOLETE - This is just here for backwards compatibility.
///
- [JsonIgnore, Obsolete("Area property does not belong on an arc", true)]
+ [Obsolete("Area property does not belong on an arc", true)]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public double area { get; set; }
///
diff --git a/src/Speckle.Objects/Geometry/Box.cs b/src/Speckle.Objects/Geometry/Box.cs
index ea91cce6..4e6ca8e0 100644
--- a/src/Speckle.Objects/Geometry/Box.cs
+++ b/src/Speckle.Objects/Geometry/Box.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Primitive;
using Speckle.Sdk.Common;
using Speckle.Sdk.Models;
@@ -11,7 +10,9 @@ namespace Speckle.Objects.Geometry;
[SpeckleType("Objects.Geometry.Box")]
public class Box : Base, IHasVolume, IHasArea, IHasBoundingBox
{
- [JsonIgnore, Obsolete("Use plane property instead", true)]
+ [Obsolete("Use plane property instead", true)]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public Plane basePlane
{
get => plane;
@@ -49,7 +50,9 @@ public Plane basePlane
///
public double area => 2 * (xSize.Length * ySize.Length + xSize.Length * zSize.Length + ySize.Length * zSize.Length);
- [JsonIgnore, Obsolete("Boxs should not have a bounding box", true)]
+ [Obsolete("Boxs should not have a bounding box", true)]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public Box? bbox { get; }
///
diff --git a/src/Speckle.Objects/Geometry/Brep.cs b/src/Speckle.Objects/Geometry/Brep.cs
index df201c32..6d323258 100644
--- a/src/Speckle.Objects/Geometry/Brep.cs
+++ b/src/Speckle.Objects/Geometry/Brep.cs
@@ -1,5 +1,4 @@
using System.Runtime.Serialization;
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Other;
using Speckle.Objects.Primitive;
using Speckle.Sdk.Common;
@@ -25,7 +24,9 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable<
///
/// Gets or sets the list of surfaces in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Surfaces { get; set; }
///
@@ -68,7 +69,9 @@ public List SurfacesValue
///
/// Gets or sets the list of 3-dimensional curves in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Curve3D { get; set; }
///
@@ -93,7 +96,9 @@ public List Curve3DValues
///
/// Gets or sets the list of 2-dimensional UV curves in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Curve2D { get; set; }
///
@@ -118,7 +123,9 @@ public List Curve2DValues
///
/// Gets or sets the list of vertices in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Vertices { get; set; }
///
@@ -158,7 +165,9 @@ public List VerticesValue
///
/// Gets or sets the list of edges in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Edges { get; set; }
///
@@ -232,7 +241,9 @@ public List EdgesValue
///
/// Gets or sets the list of closed UV loops in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Loops { get; set; }
///
@@ -288,7 +299,9 @@ public List LoopsValue
///
/// Gets or sets the list of UV trim segments for each surface in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Trims { get; set; }
///
@@ -354,7 +367,9 @@ public List TrimsValue
///
/// Gets or sets the list of faces in this instance.
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required List Faces { get; set; }
///
diff --git a/src/Speckle.Objects/Geometry/BrepEdge.cs b/src/Speckle.Objects/Geometry/BrepEdge.cs
index b2009157..b8de26fd 100644
--- a/src/Speckle.Objects/Geometry/BrepEdge.cs
+++ b/src/Speckle.Objects/Geometry/BrepEdge.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Primitive;
using Speckle.Sdk.Models;
@@ -10,7 +9,8 @@ namespace Speckle.Objects.Geometry;
[SpeckleType("Objects.Geometry.BrepEdge")]
public class BrepEdge : Base
{
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required Brep Brep { get; set; }
public required int Curve3dIndex { get; set; }
@@ -22,15 +22,19 @@ public class BrepEdge : Base
public required Interval Domain { get; set; }
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public Point StartVertex => Brep.Vertices[StartIndex];
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public Point EndVertex => Brep.Vertices[EndIndex];
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public IEnumerable Trims => TrimIndices.Select(i => Brep.Trims[i]);
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public ICurve Curve => Brep.Curve3D[Curve3dIndex];
}
diff --git a/src/Speckle.Objects/Geometry/BrepFace.cs b/src/Speckle.Objects/Geometry/BrepFace.cs
index 748f65d8..ec3c241c 100644
--- a/src/Speckle.Objects/Geometry/BrepFace.cs
+++ b/src/Speckle.Objects/Geometry/BrepFace.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Models;
namespace Speckle.Objects.Geometry;
@@ -9,7 +8,8 @@ namespace Speckle.Objects.Geometry;
[SpeckleType("Objects.Geometry.BrepFace")]
public class BrepFace : Base
{
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required Brep Brep { get; set; }
public required int SurfaceIndex { get; set; }
@@ -17,12 +17,15 @@ public class BrepFace : Base
public required int OuterLoopIndex { get; set; }
public required bool OrientationReversed { get; set; }
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public BrepLoop OuterLoop => Brep.Loops[OuterLoopIndex];
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public Surface Surface => Brep.Surfaces[SurfaceIndex];
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public List Loops => LoopIndices.Select(i => Brep.Loops[i]).ToList();
}
diff --git a/src/Speckle.Objects/Geometry/BrepLoop.cs b/src/Speckle.Objects/Geometry/BrepLoop.cs
index 095e1b7b..82ae8faa 100644
--- a/src/Speckle.Objects/Geometry/BrepLoop.cs
+++ b/src/Speckle.Objects/Geometry/BrepLoop.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Models;
namespace Speckle.Objects.Geometry;
@@ -9,16 +8,19 @@ namespace Speckle.Objects.Geometry;
[SpeckleType("Objects.Geometry.BrepLoop")]
public class BrepLoop : Base
{
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required Brep Brep { get; set; }
public required int FaceIndex { get; set; }
public required List TrimIndices { get; set; }
public required BrepLoopType Type { get; set; }
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public BrepFace Face => Brep.Faces[FaceIndex];
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public List Trims => TrimIndices.Select(i => Brep.Trims[i]).ToList();
}
diff --git a/src/Speckle.Objects/Geometry/BrepTrim.cs b/src/Speckle.Objects/Geometry/BrepTrim.cs
index 267a7454..1622226c 100644
--- a/src/Speckle.Objects/Geometry/BrepTrim.cs
+++ b/src/Speckle.Objects/Geometry/BrepTrim.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Primitive;
using Speckle.Sdk.Models;
@@ -10,7 +9,8 @@ namespace Speckle.Objects.Geometry;
[SpeckleType("Objects.Geometry.BrepTrim")]
public class BrepTrim : Base
{
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public required Brep Brep { get; set; }
public required int EdgeIndex { get; set; }
public required int StartIndex { get; set; }
@@ -24,15 +24,19 @@ public class BrepTrim : Base
public required Interval Domain { get; set; }
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public BrepFace Face => Brep.Faces[FaceIndex];
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public BrepLoop Loop => Brep.Loops[LoopIndex];
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public BrepEdge? Edge => EdgeIndex != -1 ? Brep.Edges[EdgeIndex] : null;
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public ICurve Curve2d => Brep.Curve2D[CurveIndex];
}
diff --git a/src/Speckle.Objects/Geometry/ControlPoint.cs b/src/Speckle.Objects/Geometry/ControlPoint.cs
index fd942e35..ba2e9911 100644
--- a/src/Speckle.Objects/Geometry/ControlPoint.cs
+++ b/src/Speckle.Objects/Geometry/ControlPoint.cs
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Other;
using Speckle.Sdk.Models;
@@ -23,7 +22,10 @@ public ControlPoint(double x, double y, double z, double w, string units, string
/// OBSOLETE - This is just here for backwards compatibility.
///
[
- JsonProperty(NullValueHandling = NullValueHandling.Ignore),
+ Speckle.Newtonsoft.Json.JsonProperty(NullValueHandling = Speckle.Newtonsoft.Json.NullValueHandling.Ignore),
+ System.Text.Json.Serialization.JsonIgnore(
+ Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
+ ),
Obsolete("Access coordinates using XYZ and weight fields", true)
]
private new List value
diff --git a/src/Speckle.Objects/Geometry/Line.cs b/src/Speckle.Objects/Geometry/Line.cs
index 2fe90022..486d883a 100644
--- a/src/Speckle.Objects/Geometry/Line.cs
+++ b/src/Speckle.Objects/Geometry/Line.cs
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Other;
using Speckle.Objects.Primitive;
using Speckle.Sdk.Common;
@@ -34,7 +33,9 @@ public Line(IList coordinates, string units, string? applicationId = nul
/// OBSOLETE - This is just here for backwards compatibility.
/// You should not use this for anything.
///
- [JsonIgnore, Obsolete("Area should not be on the line class", true)]
+ [Obsolete("Area should not be on the line class", true)]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public double area => 0;
public required string units { get; set; }
@@ -102,7 +103,10 @@ public static Line FromList(IReadOnlyList list)
/// You should not use this for anything. Access coordinates using start and end point.
///
[
- JsonProperty(NullValueHandling = NullValueHandling.Ignore),
+ Speckle.Newtonsoft.Json.JsonProperty(NullValueHandling = Speckle.Newtonsoft.Json.NullValueHandling.Ignore),
+ System.Text.Json.Serialization.JsonIgnore(
+ Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
+ ),
Obsolete("Access coordinates using start and end point", true)
]
public List? value
diff --git a/src/Speckle.Objects/Geometry/Mesh.cs b/src/Speckle.Objects/Geometry/Mesh.cs
index 64079c69..7aa707d6 100644
--- a/src/Speckle.Objects/Geometry/Mesh.cs
+++ b/src/Speckle.Objects/Geometry/Mesh.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Other;
using Speckle.Sdk;
using Speckle.Sdk.Common;
@@ -87,10 +86,13 @@ public bool TransformTo(Transform transform, out ITransformable transformed)
#region Convenience Methods
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public int VerticesCount => vertices.Count / 3;
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public int TextureCoordinatesCount => textureCoordinates.Count / 2;
///
diff --git a/src/Speckle.Objects/Geometry/Point.cs b/src/Speckle.Objects/Geometry/Point.cs
index 9911ce73..f6276074 100644
--- a/src/Speckle.Objects/Geometry/Point.cs
+++ b/src/Speckle.Objects/Geometry/Point.cs
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Other;
using Speckle.Sdk.Common;
using Speckle.Sdk.Models;
@@ -233,7 +232,13 @@ public Point(Vector _) { }
///
/// Gets or sets the coordinates of the
///
- [JsonProperty(NullValueHandling = NullValueHandling.Ignore), Obsolete("Use x,y,z properties instead", true)]
+ [
+ Speckle.Newtonsoft.Json.JsonProperty(NullValueHandling = Speckle.Newtonsoft.Json.NullValueHandling.Ignore),
+ System.Text.Json.Serialization.JsonIgnore(
+ Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
+ ),
+ Obsolete("Use x,y,z properties instead", true)
+ ]
public List value
{
get => null!;
diff --git a/src/Speckle.Objects/Geometry/Vector.cs b/src/Speckle.Objects/Geometry/Vector.cs
index 83114648..433ba334 100644
--- a/src/Speckle.Objects/Geometry/Vector.cs
+++ b/src/Speckle.Objects/Geometry/Vector.cs
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
-using Speckle.Newtonsoft.Json;
using Speckle.Objects.Other;
using Speckle.Sdk.Common;
using Speckle.Sdk.Models;
@@ -57,7 +56,9 @@ public Vector(double x, double y, double z, string units, string? applicationId
/// Gets the Euclidean length of this vector.
///
/// Length of the vector.
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public double Length => Math.Sqrt(DotProduct(this, this));
///
@@ -226,7 +227,10 @@ public Vector(Point point, string? applicationId = null) { }
/// Gets or sets the coordinates of the vector
///
[
- JsonProperty(NullValueHandling = NullValueHandling.Ignore),
+ Speckle.Newtonsoft.Json.JsonProperty(NullValueHandling = Speckle.Newtonsoft.Json.NullValueHandling.Ignore),
+ System.Text.Json.Serialization.JsonIgnore(
+ Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
+ ),
Obsolete("Use X,Y,Z fields to access coordinates instead", true)
]
public List value
diff --git a/src/Speckle.Objects/Other/RenderMaterial.cs b/src/Speckle.Objects/Other/RenderMaterial.cs
index b114399a..9f735479 100644
--- a/src/Speckle.Objects/Other/RenderMaterial.cs
+++ b/src/Speckle.Objects/Other/RenderMaterial.cs
@@ -1,5 +1,4 @@
using System.Drawing;
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Models;
using Speckle.Sdk.Models.Proxies;
@@ -25,14 +24,16 @@ public class RenderMaterial : Base
public int emissive { get; set; } = Color.Black.ToArgb();
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public Color diffuseColor
{
get => Color.FromArgb(diffuse);
set => diffuse = value.ToArgb();
}
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public Color emissiveColor
{
get => Color.FromArgb(emissive);
diff --git a/src/Speckle.Objects/Primitive/Interval.cs b/src/Speckle.Objects/Primitive/Interval.cs
index 0ffcfc79..012bb305 100644
--- a/src/Speckle.Objects/Primitive/Interval.cs
+++ b/src/Speckle.Objects/Primitive/Interval.cs
@@ -1,4 +1,3 @@
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Models;
namespace Speckle.Objects.Primitive;
@@ -9,7 +8,8 @@ public class Interval : Base
public required double start { get; set; }
public required double end { get; set; }
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public double Length => Math.Abs((end) - (start));
public override string ToString()
diff --git a/src/Speckle.Objects/packages.lock.json b/src/Speckle.Objects/packages.lock.json
index e0eab833..9b218112 100644
--- a/src/Speckle.Objects/packages.lock.json
+++ b/src/Speckle.Objects/packages.lock.json
@@ -168,8 +168,8 @@
},
"System.Buffers": {
"type": "Transitive",
- "resolved": "4.4.0",
- "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw=="
+ "resolved": "4.5.1",
+ "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg=="
},
"System.ComponentModel.Annotations": {
"type": "Transitive",
@@ -178,18 +178,18 @@
},
"System.Memory": {
"type": "Transitive",
- "resolved": "4.5.3",
- "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==",
+ "resolved": "4.5.4",
+ "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==",
"dependencies": {
- "System.Buffers": "4.4.0",
+ "System.Buffers": "4.5.1",
"System.Numerics.Vectors": "4.4.0",
- "System.Runtime.CompilerServices.Unsafe": "4.5.2"
+ "System.Runtime.CompilerServices.Unsafe": "4.5.3"
}
},
"System.Numerics.Vectors": {
"type": "Transitive",
- "resolved": "4.4.0",
- "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ=="
+ "resolved": "4.5.0",
+ "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ=="
},
"System.Reactive": {
"type": "Transitive",
@@ -211,8 +211,8 @@
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
- "resolved": "4.5.3",
- "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw=="
+ "resolved": "5.0.0",
+ "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA=="
},
"System.Runtime.InteropServices.WindowsRuntime": {
"type": "Transitive",
@@ -222,6 +222,14 @@
"System.Runtime": "4.3.0"
}
},
+ "System.Text.Encodings.Web": {
+ "type": "Transitive",
+ "resolved": "5.0.0",
+ "contentHash": "EEslUvHKll1ftizbn20mX3Ix/l4Ygk/bdJ2LY6/X6FlGaP0RIhKMo9nS6JIGnKKT6KBP2PGj6JC3B9/ZF6ErqQ==",
+ "dependencies": {
+ "System.Memory": "4.5.4"
+ }
+ },
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.4",
@@ -241,7 +249,8 @@
"Microsoft.Extensions.Logging": "[2.2.0, )",
"Speckle.DoubleNumerics": "[4.0.1, )",
"Speckle.Newtonsoft.Json": "[13.0.2, )",
- "Speckle.Sdk.Dependencies": "[1.0.0, )"
+ "Speckle.Sdk.Dependencies": "[1.0.0, )",
+ "System.Text.Json": "[5.0.0, )"
}
},
"speckle.sdk.dependencies": {
@@ -312,6 +321,21 @@
"requested": "[13.0.2, )",
"resolved": "13.0.2",
"contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA=="
+ },
+ "System.Text.Json": {
+ "type": "CentralTransitive",
+ "requested": "[5.0.0, )",
+ "resolved": "5.0.0",
+ "contentHash": "+luxMQNZ2WqeffBU7Ml6njIvxc8169NW2oU+ygNudXQGZiarjE7DOtN7bILiQjTZjkmwwRZGTtLzmdrSI/Ustw==",
+ "dependencies": {
+ "Microsoft.Bcl.AsyncInterfaces": "5.0.0",
+ "System.Buffers": "4.5.1",
+ "System.Memory": "4.5.4",
+ "System.Numerics.Vectors": "4.5.0",
+ "System.Runtime.CompilerServices.Unsafe": "5.0.0",
+ "System.Text.Encodings.Web": "5.0.0",
+ "System.Threading.Tasks.Extensions": "4.5.4"
+ }
}
},
"net8.0": {
@@ -484,13 +508,15 @@
"type": "Project",
"dependencies": {
"GraphQL.Client": "[6.0.0, )",
+ "Microsoft.Bcl.AsyncInterfaces": "[5.0.0, )",
"Microsoft.CSharp": "[4.7.0, )",
"Microsoft.Data.Sqlite": "[7.0.5, )",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0, )",
"Microsoft.Extensions.Logging": "[2.2.0, )",
"Speckle.DoubleNumerics": "[4.0.1, )",
"Speckle.Newtonsoft.Json": "[13.0.2, )",
- "Speckle.Sdk.Dependencies": "[1.0.0, )"
+ "Speckle.Sdk.Dependencies": "[1.0.0, )",
+ "System.Text.Json": "[5.0.0, )"
}
},
"speckle.sdk.dependencies": {
@@ -507,6 +533,12 @@
"System.Reactive": "5.0.0"
}
},
+ "Microsoft.Bcl.AsyncInterfaces": {
+ "type": "CentralTransitive",
+ "requested": "[5.0.0, )",
+ "resolved": "5.0.0",
+ "contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ=="
+ },
"Microsoft.CSharp": {
"type": "CentralTransitive",
"requested": "[4.7.0, )",
@@ -552,6 +584,12 @@
"requested": "[13.0.2, )",
"resolved": "13.0.2",
"contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA=="
+ },
+ "System.Text.Json": {
+ "type": "CentralTransitive",
+ "requested": "[5.0.0, )",
+ "resolved": "5.0.0",
+ "contentHash": "+luxMQNZ2WqeffBU7Ml6njIvxc8169NW2oU+ygNudXQGZiarjE7DOtN7bILiQjTZjkmwwRZGTtLzmdrSI/Ustw=="
}
}
}
diff --git a/src/Speckle.Sdk/Api/Operations/Operations.Serialize.cs b/src/Speckle.Sdk/Api/Operations/Operations.Serialize.cs
index 075776f2..25bd64c9 100644
--- a/src/Speckle.Sdk/Api/Operations/Operations.Serialize.cs
+++ b/src/Speckle.Sdk/Api/Operations/Operations.Serialize.cs
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Logging;
using Speckle.Sdk.Models;
using Speckle.Sdk.Serialisation;
@@ -35,7 +34,6 @@ public string Serialize(Base value, CancellationToken cancellationToken = defaul
///
///
/// was null
- /// was not valid JSON
/// cannot be deserialised to type
/// contains closure references (see Remarks)
public async Task DeserializeAsync(string value, CancellationToken cancellationToken = default)
diff --git a/src/Speckle.Sdk/Host/TypeLoader.cs b/src/Speckle.Sdk/Host/TypeLoader.cs
index 18159abe..88dd094c 100644
--- a/src/Speckle.Sdk/Host/TypeLoader.cs
+++ b/src/Speckle.Sdk/Host/TypeLoader.cs
@@ -1,6 +1,5 @@
using System.Collections.Concurrent;
using System.Reflection;
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Models;
namespace Speckle.Sdk.Host;
@@ -14,13 +13,19 @@ public static class TypeLoader
private static ConcurrentDictionary s_cachedTypes = new();
private static ConcurrentDictionary s_fullTypeStrings = new();
- private static ConcurrentDictionary s_jsonPropertyAttribute = new();
+ private static ConcurrentDictionary<
+ PropertyInfo,
+ Speckle.Newtonsoft.Json.JsonPropertyAttribute?
+ > s_jsonPropertyAttribute = new();
private static ConcurrentDictionary> s_propInfoCache = new();
public static IEnumerable Types => s_availableTypes;
- public static JsonPropertyAttribute? GetJsonPropertyAttribute(PropertyInfo property) =>
- s_jsonPropertyAttribute.GetOrAdd(property, p => p.GetCustomAttribute(true));
+ public static Speckle.Newtonsoft.Json.JsonPropertyAttribute? GetJsonPropertyAttribute(PropertyInfo property) =>
+ s_jsonPropertyAttribute.GetOrAdd(
+ property,
+ p => p.GetCustomAttribute(true)
+ );
public static void Initialize(params Assembly[] assemblies)
{
diff --git a/src/Speckle.Sdk/Models/Base.cs b/src/Speckle.Sdk/Models/Base.cs
index d68e31e7..65da9363 100644
--- a/src/Speckle.Sdk/Models/Base.cs
+++ b/src/Speckle.Sdk/Models/Base.cs
@@ -2,7 +2,6 @@
using System.Collections;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
-using Speckle.Newtonsoft.Json;
using Speckle.Newtonsoft.Json.Linq;
using Speckle.Sdk.Common;
using Speckle.Sdk.Helpers;
@@ -99,7 +98,9 @@ private static long CountDescendants(Base @base, ISet parsed)
foreach (var prop in typedProps.Where(p => p.CanRead))
{
bool isIgnored =
- prop.IsDefined(typeof(ObsoleteAttribute), true) || prop.IsDefined(typeof(JsonIgnoreAttribute), true);
+ prop.IsDefined(typeof(ObsoleteAttribute), true)
+ || prop.IsDefined(typeof(Speckle.Newtonsoft.Json.JsonIgnoreAttribute), true)
+ || prop.IsDefined(typeof(System.Text.Json.Serialization.JsonIgnoreAttribute), true);
if (isIgnored)
{
continue;
diff --git a/src/Speckle.Sdk/Models/Blob.cs b/src/Speckle.Sdk/Models/Blob.cs
index ad6706b8..f34bb42e 100644
--- a/src/Speckle.Sdk/Models/Blob.cs
+++ b/src/Speckle.Sdk/Models/Blob.cs
@@ -1,13 +1,13 @@
#nullable disable
using System.Runtime.Serialization;
-using Speckle.Newtonsoft.Json;
namespace Speckle.Sdk.Models;
[SpeckleType("Speckle.Core.Models.Blob")]
public class Blob : Base
{
- [JsonIgnore]
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public static int LocalHashPrefixLength => 20;
private string _filePath;
diff --git a/src/Speckle.Sdk/Models/DynamicBase.cs b/src/Speckle.Sdk/Models/DynamicBase.cs
index 483bda4a..5ba1edbb 100644
--- a/src/Speckle.Sdk/Models/DynamicBase.cs
+++ b/src/Speckle.Sdk/Models/DynamicBase.cs
@@ -1,6 +1,5 @@
using System.Dynamic;
using System.Reflection;
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Common;
using Speckle.Sdk.Host;
@@ -273,7 +272,9 @@ public static IEnumerable GetInstanceMembers(Type t)
/// Gets the dynamically added property names only.
///
///
- [JsonIgnore]
+
+ [Newtonsoft.Json.JsonIgnore]
+ [System.Text.Json.Serialization.JsonIgnore]
public IReadOnlyCollection DynamicPropertyKeys => _properties.Keys;
}
diff --git a/src/Speckle.Sdk/Serialisation/V2/Receive/DeserializeProcess.cs b/src/Speckle.Sdk/Serialisation/V2/Receive/DeserializeProcess.cs
index 1db2e0a4..60167628 100644
--- a/src/Speckle.Sdk/Serialisation/V2/Receive/DeserializeProcess.cs
+++ b/src/Speckle.Sdk/Serialisation/V2/Receive/DeserializeProcess.cs
@@ -132,7 +132,11 @@ private Base Deserialise(string id, string json)
return baseObject;
}
+#if NETSTANDARD2_0
var deserializer = objectDeserializerFactory.Create(_baseCache);
+#else
+ var deserializer = objectDeserializerFactory.Create2(_baseCache, _options);
+#endif
return deserializer.Deserialize(json);
}
}
diff --git a/src/Speckle.Sdk/Serialisation/V2/Receive/DictionaryConverter.cs b/src/Speckle.Sdk/Serialisation/V2/Receive/DictionaryConverter.cs
index f1b1e07d..3368cf6c 100644
--- a/src/Speckle.Sdk/Serialisation/V2/Receive/DictionaryConverter.cs
+++ b/src/Speckle.Sdk/Serialisation/V2/Receive/DictionaryConverter.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Common;
using Speckle.Sdk.Host;
using Speckle.Sdk.Models;
@@ -34,8 +33,8 @@ public static Base Dict2Base(Dictionary dictObj, bool skipInval
if (entry.Value == null)
{
// Check for JsonProperty(NullValueHandling = NullValueHandling.Ignore) attribute
- JsonPropertyAttribute? attr = TypeLoader.GetJsonPropertyAttribute(value);
- if (attr is { NullValueHandling: NullValueHandling.Ignore })
+ Speckle.Newtonsoft.Json.JsonPropertyAttribute? attr = TypeLoader.GetJsonPropertyAttribute(value);
+ if (attr is { NullValueHandling: Speckle.Newtonsoft.Json.NullValueHandling.Ignore })
{
continue;
}
diff --git a/src/Speckle.Sdk/Serialisation/V2/Receive/ObjectDeserializer2.cs b/src/Speckle.Sdk/Serialisation/V2/Receive/ObjectDeserializer2.cs
new file mode 100644
index 00000000..96871a4e
--- /dev/null
+++ b/src/Speckle.Sdk/Serialisation/V2/Receive/ObjectDeserializer2.cs
@@ -0,0 +1,159 @@
+#if !NETSTANDARD2_0
+using System.Text;
+using System.Text.Json;
+using Speckle.Sdk.Common;
+using Speckle.Sdk.Dependencies;
+using Speckle.Sdk.Models;
+
+namespace Speckle.Sdk.Serialisation.V2.Receive;
+
+public sealed class ObjectDeserializer2(
+ IReadOnlyDictionary references,
+ DeserializeOptions? options = null
+) : IObjectDeserializer
+{
+ /// The JSON string of the object to be deserialized
+ /// A typed object deserialized from the
+ /// was null
+ /// cannot be deserialised to type
+ // /// did not contain the required json objects (closures)
+ public Base Deserialize(string objectJson)
+ {
+ if (objectJson is null)
+ {
+ throw new ArgumentNullException(nameof(objectJson), $"Cannot deserialize {nameof(objectJson)}, value was null");
+ }
+ // Apparently this automatically parses DateTimes in strings if it matches the format:
+ // JObject doc1 = JObject.Parse(objectJson);
+
+ // This is equivalent code that doesn't parse datetimes:
+ var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(objectJson));
+
+ Base? converted;
+ try
+ {
+ reader.Read();
+ converted = (Base)ReadObject(ref reader).NotNull();
+ }
+ catch (Exception ex) when (!ex.IsFatal() && ex is not OperationCanceledException)
+ {
+ throw new SpeckleDeserializeException("Failed to deserialize", ex);
+ }
+
+ return converted;
+ }
+
+ private List