Class JsonSchemaPropertyKeys
- Namespace
- Solace.SchemaRegistry.Serdes.JsonSchema
- Assembly
- Solace.SchemaRegistry.Serdes.JsonSchema.dll
Contains property key constants for Json Schema SERDES configuration.
public class JsonSchemaPropertyKeys : SerdePropertyKeys
- Inheritance
-
JsonSchemaPropertyKeys
- Inherited Members
Constructors
JsonSchemaPropertyKeys()
Initializes a new instance of the JsonSchemaPropertyKeys class.
protected JsonSchemaPropertyKeys()
Fields
TypeProperty
An optional property that specifies the JSON schema property name that contains the .NET type class path for deserialization.
The JsonSchemaDeserializer<T> uses this JSON schema property to determine the target .NET class when deserializing.
The JSON schema must include this property as a key at the root level with a string value matching the target type's fully qualified name
(e.g., the value returned by typeof(MyType).AssemblyQualifiedName).
For example, if the property is set to "dotnetType", the schema should contain: "dotnetType": "MyNamespace.MyClass, MyAssembly".
The default value is "dotnetType".
public const string TypeProperty = "solace.jsonschema.type-property"
Field Value
- See Also
ValidateSchema
An optional property that controls whether JSON schema validation is performed during serialization and deserialization.
When set to true, data is validated against the resolved JSON schema and a
JsonSchemaValidationException is thrown if validation fails.
The default value is true.
public const string ValidateSchema = "solace.jsonschema.validate-schema"
Field Value
- See Also
ValidationErrorHandler
An optional property that specifies a callback handler for JSON schema validation errors.
When set, validation errors are passed to the handler which returns a
JsonSchemaValidationException to throw, or null to suppress the error.
The value must be a Func<T, TResult>.
The default value is null (no handler, default exception is thrown).
Warning: The handler is invoked synchronously on the serialization thread. Avoid performing long-running or blocking operations inside the handler. If the handler itself throws an exception (rather than returning one), it will be caught and wrapped in a Solace.Serdes.SerializationException.
public const string ValidationErrorHandler = "solace.jsonschema.validation-error-handler"
Field Value
- See Also