Skip to main content

OctoJsonSchemaAttribute

Namespace: Meshmakers.Octo.ConstructionKit.Contracts.Serialization

Identifies a to use when deserializing a type.

public class OctoJsonSchemaAttribute : Attribute

Inheritance Object → Attribute → OctoJsonSchemaAttribute

Remarks:

This is a copy of the JsonSchemaAttribute from JsonSchema.Net library. It is copied because the original contains an issue that results in a stack overflow when used with the ValidatingJsonConverter. This behavior is fixed and can be reproduced using the original library by adding a schema to a type that references itself. Executing all Unit tests will fail with NullReferenceExceptions.

Properties​

Schema​

The schema to use when deserializing the type.

public JsonSchema Schema { get; }

Property Value​

JsonSchema

TypeId​

public object TypeId { get; }

Property Value​

Object

Constructors​

OctoJsonSchemaAttribute(Type, String)​

Identifies a to use when deserializing a type.

public OctoJsonSchemaAttribute(Type declaringType, string memberName)

Parameters​

declaringType Type
The type declaring the schema.

memberName String
The property or field name for the schema. This member must be public and static.

Exceptions​

ArgumentException
Thrown when the member cannot be found or is not public and static.