diff --git a/src/Speckle.Objects/Geometry/Brep.cs b/src/Speckle.Objects/Geometry/Brep.cs index df201c32..c02ea6d6 100644 --- a/src/Speckle.Objects/Geometry/Brep.cs +++ b/src/Speckle.Objects/Geometry/Brep.cs @@ -31,7 +31,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// Gets or sets the flat list of numbers representing the 's surfaces. /// - [DetachProperty, SchemaIgnore, Chunkable(31250)] + [DetachProperty, Chunkable(31250)] public List SurfacesValue { get @@ -77,7 +77,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// This is only used for the class serialisation/deserialisation. You should use instead. /// - [DetachProperty, SchemaIgnore, Chunkable(31250)] + [DetachProperty, Chunkable(31250)] public List Curve3DValues { get => CurveArrayEncodingExtensions.ToArray(Curve3D); @@ -102,7 +102,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// This is only used for the class serialisation/deserialisation. You should use instead. /// - [DetachProperty, SchemaIgnore, Chunkable(31250)] + [DetachProperty, Chunkable(31250)] public List Curve2DValues { get => CurveArrayEncodingExtensions.ToArray(Curve2D); @@ -127,7 +127,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// This is only used for the class serialisation/deserialisation. You should use instead. /// - [DetachProperty, SchemaIgnore, Chunkable(31250)] + [DetachProperty, Chunkable(31250)] public List VerticesValue { get @@ -167,7 +167,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// This is only used for the class serialisation/deserialisation. You should use instead. /// - [DetachProperty, SchemaIgnore, Chunkable(62500)] + [DetachProperty, Chunkable(62500)] public List EdgesValue { get => @@ -241,7 +241,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// This is only used for the class serialisation/deserialisation. You should use instead. /// - [DetachProperty, SchemaIgnore, Chunkable(62500)] + [DetachProperty, Chunkable(62500)] public List LoopsValue { get => @@ -297,7 +297,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// This is only used for the class serialisation/deserialisation. You should use instead. /// - [DetachProperty, SchemaIgnore, Chunkable(62500)] + [DetachProperty, Chunkable(62500)] public List TrimsValue { get @@ -363,7 +363,7 @@ public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable< /// /// This is only used for the class serialisation/deserialisation. You should use instead. /// - [DetachProperty, SchemaIgnore, Chunkable(62500)] + [DetachProperty, Chunkable(62500)] public List FacesValue { get => diff --git a/src/Speckle.Sdk/Host/Attributes.cs b/src/Speckle.Sdk/Host/Attributes.cs deleted file mode 100644 index b30e6989..00000000 --- a/src/Speckle.Sdk/Host/Attributes.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Speckle.Sdk.Host; - -// TODO: this could be nuked, as it's only used to hide props on Base, -// which we might want to expose anyways... -/// -/// Used to ignore properties from expand objects etc -/// -[AttributeUsage(AttributeTargets.Property)] -public sealed class SchemaIgnoreAttribute : Attribute; - -[AttributeUsage(AttributeTargets.Method)] -public sealed class SchemaComputedAttribute(string name) : Attribute -{ - public string Name { get; } = name; -} diff --git a/src/Speckle.Sdk/Models/Base.cs b/src/Speckle.Sdk/Models/Base.cs index 45b8efed..33a4886a 100644 --- a/src/Speckle.Sdk/Models/Base.cs +++ b/src/Speckle.Sdk/Models/Base.cs @@ -28,20 +28,17 @@ public class Base : DynamicBase, ISpeckleObject /// /// A speckle object's id is an unique hash based on its properties. NOTE: this field will be null unless the object was deserialised from a source. Use the function to get it. /// - [SchemaIgnore] public virtual string? id { get; set; } /// /// Secondary, ideally host application driven, object identifier. /// - [SchemaIgnore] public string? applicationId { get; set; } /// /// Holds the type information of this speckle object, derived automatically /// from its assembly name and inheritance. /// - [SchemaIgnore] public virtual string speckle_type { get @@ -210,11 +207,7 @@ public class Base : DynamicBase, ISpeckleObject myDuplicate.id = id; myDuplicate.applicationId = applicationId; - foreach ( - var kvp in GetMembers( - DynamicBaseMemberType.Instance | DynamicBaseMemberType.Dynamic | DynamicBaseMemberType.SchemaIgnored - ) - ) + foreach (var kvp in GetMembers()) { var propertyInfo = type.GetProperty(kvp.Key); if (propertyInfo is not null && !propertyInfo.CanWrite) diff --git a/src/Speckle.Sdk/Models/DynamicBase.cs b/src/Speckle.Sdk/Models/DynamicBase.cs index 483bda4a..e7f3e953 100644 --- a/src/Speckle.Sdk/Models/DynamicBase.cs +++ b/src/Speckle.Sdk/Models/DynamicBase.cs @@ -1,7 +1,6 @@ using System.Dynamic; using System.Reflection; using Speckle.Newtonsoft.Json; -using Speckle.Sdk.Common; using Speckle.Sdk.Host; namespace Speckle.Sdk.Models; @@ -233,16 +232,12 @@ public class DynamicBase : DynamicObject, IDynamicMetaObjectProvider .GetBaseProperties(GetType()) .Where(x => { - var hasIgnored = x.IsDefined(typeof(SchemaIgnoreAttribute), true); var hasObsolete = x.IsDefined(typeof(ObsoleteAttribute), true); // If obsolete is false and prop has obsolete attr // OR // If schemaIgnored is true and prop has schemaIgnore attr - return !( - !includeMembers.HasFlag(DynamicBaseMemberType.SchemaIgnored) && hasIgnored - || !includeMembers.HasFlag(DynamicBaseMemberType.Obsolete) && hasObsolete - ); + return !(!includeMembers.HasFlag(DynamicBaseMemberType.Obsolete) && hasObsolete); }); foreach (var pi in pinfos) { @@ -252,20 +247,6 @@ public class DynamicBase : DynamicObject, IDynamicMetaObjectProvider } } } - - if (includeMembers.HasFlag(DynamicBaseMemberType.SchemaComputed)) - { - GetType() - .GetMethods() - .Where(e => e.IsDefined(typeof(SchemaComputedAttribute)) && !e.IsDefined(typeof(ObsoleteAttribute))) - .ToList() - .ForEach(e => - { - var attr = e.GetCustomAttribute().NotNull(); - dic[attr.Name] = e.Invoke(this, null); - }); - } - return dic; } diff --git a/src/Speckle.Sdk/Models/DynamicBaseMemberType.cs b/src/Speckle.Sdk/Models/DynamicBaseMemberType.cs index 3403bf2a..fc114380 100644 --- a/src/Speckle.Sdk/Models/DynamicBaseMemberType.cs +++ b/src/Speckle.Sdk/Models/DynamicBaseMemberType.cs @@ -1,5 +1,3 @@ -using Speckle.Sdk.Host; - namespace Speckle.Sdk.Models; /// @@ -23,23 +21,18 @@ public enum DynamicBaseMemberType /// Obsolete = 4, - /// - /// The typed members flagged with attribute. - /// - SchemaIgnored = 8, - /// /// The typed methods flagged with TODO: /// SchemaComputed = 16, /// - /// All the typed members, including ones with or attributes. + /// All the typed members, including ones with attributes. /// - InstanceAll = Instance + Obsolete + SchemaIgnored, + InstanceAll = Instance + Obsolete, /// - /// All the members, including dynamic and instance members flagged with or attributes + /// All the members, including dynamic and instance members flagged with attributes /// All = InstanceAll + Dynamic, }