review(Driver.OpcUaClient.Browser): add JsonStringEnumConverter (systemic enum bug)
Cross-module fix from the review sweep. -003 (Medium): the browser's JsonOpts lacked JsonStringEnumConverter (the factory+probe both carry it), so AdminUI string-enum configs (AuthType/SecurityPolicy/SecurityMode/TargetNamespaceKind) threw on deserialize. Added the converter (accepts string AND numeric) + TDD.
This commit is contained in:
+4
-4
@@ -19,10 +19,10 @@ public sealed class OpcUaClientBrowseSessionTests
|
||||
private static string Endpoint =>
|
||||
Environment.GetEnvironmentVariable("OPCUA_SIM_ENDPOINT") ?? "opc.tcp://10.100.0.35:50000";
|
||||
|
||||
// Enum values use their numeric ordinal because the browser uses default
|
||||
// System.Text.Json with no JsonStringEnumConverter. SecurityPolicy.None,
|
||||
// SecurityMode.None, OpcUaAuthType.Anonymous are all index 0, so omitting them
|
||||
// also works — keeping them explicit for documentation value.
|
||||
// SecurityPolicy.None, SecurityMode.None, OpcUaAuthType.Anonymous are all
|
||||
// index 0 and can also be written as string names now that the browser carries
|
||||
// JsonStringEnumConverter (Driver.OpcUaClient.Browser-003). Numeric ordinals are
|
||||
// kept here as they were before the fix — both forms are accepted.
|
||||
private static string ConfigJson => $$"""
|
||||
{
|
||||
"EndpointUrl":"{{Endpoint}}",
|
||||
|
||||
Reference in New Issue
Block a user