Make payload member length non-nullable - #127
Merged
bruno-f-cruz merged 1 commit intoAug 24, 2026
Merged
Conversation
Declare the payload member length as an int, matching the register, and read it directly wherever it was previously converted from null to zero. A missing length still means a single element, and generated output is unchanged for every target. The interop value builder now sizes an explicit length of zero as one element rather than zero, which no device schema declares. Closes harp-tech#125
glopesdev
added a commit
that referenced
this pull request
Aug 24, 2026
Declare the payload member length as an int, matching the register, and read it directly wherever it was previously converted from null to zero. A missing length still means a single element, and generated output is unchanged for every target. The interop value builder now sizes an explicit length of zero as one element rather than zero, which no device schema declares. Closes #125
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The payload member length is now declared as an
int, matching the register length. A member declaring no length continues to mean a single element.C#, Python and firmware interfaces generate every expected output file exactly as before. The round-trip serializer test also passes unchanged, since a zero
intis omitted from written YAML underOmitDefaultsexactly as a null is underOmitNull.PayloadMemberInfo.Lengthchanges the type of a public field, so anything reading it directly is affected.RegisterInfo.Lengthis unaffected, having always been anint.Notes for review
Offsetstays nullable.member.Offset.HasValuedecides whether a member of an array register is indexed, and an offset of zero is both legal and common, so absence and zero must stay distinct there.Closes #125