OPCFoundation.NetStandard.Opc.Ua.Core.Schema 2.0.1

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.

It also generates the OpenAPI 3.0 document of the REST binding (WebApiOpenApiGenerator, Part 6 G.3) from the route table and the request and response types, either with a JSON object as every body or with a component schema per message and structure.

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.

Showing the top 20 packages that depend on OPCFoundation.NetStandard.Opc.Ua.Core.Schema.

Packages Downloads
OPCFoundation.NetStandard.Opc.Ua.Server
OPC UA Server Class Library
1

https://github.com/OPCFoundation/UA-.NETStandard/releases

.NET 10.0

.NET 8.0

.NET 9.0

.NET Framework 4.8

Version Downloads Last updated
2.0.1 1 18.10.2026
2.0.0-preview.6 1 03.10.2026
2.0.0-preview.5 1 03.10.2026
2.0.0-preview.4 1 03.10.2026
2.0.0-preview.3 1 03.10.2026