Solace JSON Schema Registry SERDES for .NET. This includes the following: - JSON Schema SERDES classes for JsonSchemaSerializer and JsonSchemaDeserializer - Support for JSON schema validation and custom validation - JSON Schema SERDES configuration For more information please look at https://docs.solace.com/Solace-PubSub-Messaging-APIs/dotNet-API/net-api-home.htm.
Install
| Product | Versions |
|---|---|
| .NET Standard |
README
Solace JSON Schema Registry SERDES for .NET
A high-performance JSON Schema serialization and deserialization library for Solace event brokers, providing seamless integration with Schema Registry for type-safe messaging.
Features
- JSON Schema Serialization/Deserialization: High-performance async serializers and deserializers for JSON Schema-based messaging
- Schema Registry Integration: Automatic schema resolution and validation through Solace Schema Registry
- Type Safety: Compile-time type checking with runtime schema validation
- Error Handling: Comprehensive
JsonSchemaValidationExceptionfor schema validation failures - Configurable: Flexible configuration options for serialization behavior via
JsonSchemaPropertyKeys - Cross-Platform: Targets .NET Standard 2.0 for broad compatibility
Installation
Install the package from NuGet:
dotnet add package Solace.SchemaRegistry.Serdes.JsonSchema
Or via Package Manager Console:
Install-Package Solace.SchemaRegistry.Serdes.JsonSchema
Quick Start
Basic Usage
using Solace.SchemaRegistry.Serdes.JsonSchema;
using Solace.SchemaRegistry.Serdes.Core.Resolver;
using System.Collections.Generic;
using System.Threading.Tasks;
// Build configuration properties
var configurationProperties = new Dictionary<string, object>
{
{ SchemaResolverPropertyKeys.RegistryUrl, "https://your-registry-url/apis/registry/v3" },
{ SchemaResolverPropertyKeys.AuthUsername, "your-username" },
{ SchemaResolverPropertyKeys.AuthPassword, "your-password" },
// JsonSchemaPropertyKeys constants
{ JsonSchemaPropertyKeys.ValidateSchema, true }
};
// Configure the serializer
var serializer = new JsonSchemaSerializer<MyDataClass>();
serializer.Configure(configurationProperties);
// Serialize your data asynchronously
byte[] serializedData = await serializer.SerializeAsync("my-topic", myDataObject, headers);
// Configure the deserializer
var deserializer = new JsonSchemaDeserializer<MyDataClass>();
deserializer.Configure(configurationProperties);
// Deserialize the data asynchronously
MyDataClass deserializedObject = await deserializer.DeserializeAsync("my-topic", serializedData, headers);
Error Handling
using Solace.SchemaRegistry.Serdes.JsonSchema;
try
{
var result = await deserializer.DeserializeAsync("my-topic", data, headers);
}
catch (JsonSchemaValidationException ex)
{
// Handle schema validation errors
Console.WriteLine($"JSON Schema validation failed: {ex.Message}");
}
Resource Management
// Always dispose of serializers and deserializers when done
using var serializer = new JsonSchemaSerializer<MyDataClass>();
using var deserializer = new JsonSchemaDeserializer<MyDataClass>();
Key Classes
JsonSchemaSerializer<T>: Async serializer for converting objects to byte arrays with JSON Schema validationJsonSchemaDeserializer<T>: Async deserializer for converting byte arrays back to objects with JSON Schema validationJsonSchemaPropertyKeys: Configuration key constants for customizing serialization behaviorJsonSchemaValidationException: Exception thrown when JSON Schema validation fails
Dependencies
- NJsonSchema: JSON Schema validation library
- Solace.SchemaRegistry.Serdes.Core: Core abstractions and schema registry client
Requirements
- .NET Standard 2.0 or higher
- C# 7.3 or later
Documentation
For detailed documentation and examples, visit Solace Documentation.
License
Licensed under the Solace Community License, Version 1.0. See LICENSE for details.
Support
For questions and support, please visit the Solace Community or refer to the official Solace documentation.
Copyright 2026 Solace Corporation. All rights reserved.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.