Commit Graph

2 Commits

Author SHA1 Message Date
Marc Schier 62658d1a44 Fix runtime schema resolution and direct construction (#4426)
# Description

Fix runtime schema resolution and provide a supported DI-free
construction path for generated data types.

- Resolve registered data types by local/index-form and namespace-URI
identifiers without using BrowseName as a namespace mapping.
- Preserve identifier kind in URI registry keys, so numeric zero and
empty GUID/string/ByteString identifiers remain distinct in nonzero
namespaces, including during replacement.
- Reconstruct typed identifiers during factory URI-to-index fallback
while retaining exact lookup precedence and
unknown-namespace/remote-server guards.
- Make the built-in JSON, XSD, and BSD generators public, stabilize
`EncodeableFactoryDefinitionSource`, and document generated
activator/factory usage.
- Keep the stable-API assertion effective across the
netstandard2.1/net8.0 polyfill boundary by inspecting attribute metadata
without referencing the ambiguous CLR type.
- Merge the latest `master` without dropping upstream changes.

## Related Issues

- Fixes #4423
- Fixes #4424

## Validation

- `Opc.Ua.Core.Schema.Tests`: 157/157 on `net10.0`
- `Opc.Ua.Core.Schema.Tests`: 157/157 on `net48`
- `Opc.Ua.Core.Schema.Tests`: 157/157 with
`CustomTestTarget=netstandard2.1` and its `net8.0` consumer
- Managed `SchemaAotTests`: 4/4
- NativeAOT Release publish and filtered `SchemaAotTests`: 4/4
- All three review reproductions pass against rebuilt assemblies.

## Checklist

- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [x] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [x] I have added all necessary documentation.
- [x] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [ ] I ran **all** tests locally using the **UA.slnx** solution against
at least .net **framework** and .net **10**, and all passed.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b17fd166-fdef-4660-a9d5-97c0e69f1bd5
2026-09-06 19:17:49 +02:00
Marc Schier 7cec2d614d Move repository files to the consolidated layout 2026-07-16 06:25:54 +02:00