Skip to content

[PubSub] Publishing UInt32 0 values broken in JSON encoding #3300

Description

@jnsjll

Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

Publishing a UInt32 0 value with FieldTypeEncodingMask.DataValue field type encoding does not publish the actual Value field. This is due to an equals check against StatusCode.Good (uint 0) in the Json encoder:

Image Image

Expected Behavior

UInt 0 values can be published, i.e.:

"UInt32": {
  "Value": 0
  "SourceTimestamp": "2025-10-30T13:41:29.8386075Z"
}

Steps To Reproduce

Add UInt field in ConsoleReferencePublisher with initial value of 0u.
Set the corresponding DataSetWriterDataType.DataSetFieldContentMask = (uint)(DataSetFieldContentMask.StatusCode | DataSetFieldContentMask.SourceTimestamp)

Environment

- OS: Windows 11
- Runtime: .NET 8
- Nuget Version: 1.05.374
- Component: Opc.Ua.PubSub

Anything else?

I can provide a PR for that.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions