Skip to main content
net10.0.NETFramework4.7.2.NETFramework4.8net8.0net9.0.NETStandard2.1

OPC UA runtime schema generation (XSD, OPC Binary and JSON Schema) for encodeable and complex data types.

Published
Sep 17, 2026
1mo ago
Total Downloads
5.0K
5,044

Install

dotnet add package OPCFoundation.NetStandard.Opc.Ua.Core.Schema --version 2.0.0-preview.5
ProductVersions
.NET
net10.0net8.0net9.0
.NET Standard
netstandard2.1
Other
.NETFramework4.7.2.NETFramework4.8

README

OPCFoundation.NetStandard.Opc.Ua.Core.Schema

Runtime schema generation for OPC UA data types.

This package produces schemas for the encodeable types generated by the OPC UA stack and for complex types that are added dynamically at runtime. Schemas are built as strongly-typed object models in code (no embedded schema strings), so unused generation paths are trimmed away and the feature is NativeAOT friendly.

Supported encodings:

  • XSD for the XML encoding.
  • BSD (OPC Binary, Part 6) for the binary encoding.
  • JSON Schema (Part 6 Annex C) for the JSON encoding, in both compact (reversible) and verbose flavors.

Usage

IServiceProvider services = new ServiceCollection()
    .AddOpcUa()
    .AddSchemaGeneration()
    .Services
    .BuildServiceProvider();

ISchemaProvider provider = services.GetRequiredService<ISchemaProvider>();

if (provider.TryGetSchema(typeId, UaSchemaFormat.JsonCompact, UaSchemaScope.Type, out IUaSchema? schema))
{
    string json = schema.ToSchemaString();
}

The provider can also be assembled without dependency injection:

IDataTypeDefinitionResolver resolver = new DataTypeDefinitionRegistry();
ISchemaProvider provider = new DefaultSchemaProvider(
    resolver,
    [
        new JsonSchemaGenerator(),
        new XsdSchemaGenerator(),
        new BsdSchemaGenerator()
    ]);

Generated model registration extensions add public structure and enumeration activators to an IEncodeableFactory. Use EncodeableFactoryDefinitionSource when schemas should be resolved directly from those compiled definitions instead of a manual registry.

See docs/SchemaGeneration.md in the repository for details.

Changes from Previous Version

No structural changes between v2.0.0-preview.4 and v2.0.0-preview.5.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 6 target frameworks; confirm the exact target used by your application.The published metadata declares 124 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.