3 Commits

Author SHA1 Message Date
Marc Schier 70abb05841 Remove Default JSON encoding infrastructure (#3713)
* Remove Default JSON encoding infrastructure

Remove IJsonEncodeable interface, JsonEncodingId properties, DefaultJson
constants, and all source generator JSON encoding output. The actual
JsonEncoder/JsonDecoder and PubSub JSON encoding are not affected.

- Delete IJsonEncodeable interface from IEncodable.cs
- Remove DataTypeAttribute.JsonEncodingId and simplify TryGetTypeIdsFromType
- Remove JSON encoding from 9 source generator files
- Remove IJsonEncodeable from 13 built-in types and 12 node types
- Remove JSON registration from EncodeableFactory and unboundTypeIds infra
- Remove jsonEncodingId from OptionSet, ComplexTypeSystem, IComplexTypeFactory
- Remove BrowseNames.DefaultJson and 25 *_Encoding_DefaultJson constants
- Update ~14 test files and 2 documentation files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add IJsonEncodeable removal to migration guide

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* minor

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-29 17:39:43 +02:00
Marc Schier 26a0b21881 Replace session state encoder with IEncodable generation using source generators (#3673)
* Replace SessionStateEncoder with IEncodeable on session/subscription models

- Source-gen [DataType]/[DataTypeField] on: MonitoredItemOptions, MonitoredItemState,
  SubscriptionOptions, SubscriptionState (auto-generated Encode/Decode/IsEqual/Clone)
- Manual IEncodeable on: SessionOptions, SessionState, SessionConfiguration
  (ConfiguredEndpoint and IUserIdentity require manual encoding)
- Delete SessionStateEncoder.cs (488 lines removed)
- Remove [DataContract]/[DataMember]/[KnownType]/[CollectionDataContract] attributes
- Remove JsonSerializerContext classes
- Change init -> set, byte[] -> ByteString, DateTime -> DateTimeUtc
- MonitoredItems: ArrayOf<MonitoredItemState> with StructureHandling.Inline
- Subscriptions: ArrayOf<SubscriptionState>

* Source generator: support partial init properties with backing fields

Add IsInitOnly detection to the [DataType] source generator so that
partial properties with init-only setters can be used in IEncodeable types.

For each init-only partial property, the generator:
- Emits a private backing field (__PropertyName)
- Emits the partial property implementation (get => __field; init => __field = value)
- Uses the backing field in Decode() instead of the property
- Skips simple init-only fields in Clone() (record 'with' already copies them)
Detection uses both IPropertySymbol.SetMethod.IsInitOnly and syntax-tree
fallback (SyntaxKind.InitAccessorDeclaration) for partial definitions.
* docs: add partial init properties and session state migration sections

- SourceGeneratedDataTypes.md: new 'Partial Init Properties' section
  documenting backing field generation for init-only partial properties
- MigrationGuide.md: new 'Session State Persistence' section covering
2026-04-19 13:39:01 +02:00
Marc Schier fd41681f4b Add support to publish OPC UA applications as Native AOT (#3633)
* make most ptojects aot compatible
* Remove newtonsoft
* Migrate all projects from Mono.Options to System.CommandLine 2.0.5
* Fix array clone
* Replace serializers for storage using new attribute driven  type geberator
* Add new AOT integration tests covering all functional areas
* Documentation updates
2026-04-13 20:52:29 +02:00