Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update reader's emHeader method to return whether it read a sentinelHeader #24

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

snosenzo
Copy link
Contributor

This is needed to better support optional members of aggregated types in XCDR.

Related: FG-6436

@snosenzo snosenzo merged commit 9c77f5b into main Feb 28, 2024
1 check passed
@snosenzo snosenzo deleted the optional-members branch February 28, 2024 19:48
snosenzo added a commit to foxglove/omgidl that referenced this pull request Feb 29, 2024
Absent fields in structs do not write emHeaders, so the reading of the
emHeader for the field will either return a future field's emHeader or a
sentinelHeader. To allow for this, our reader stores the emHeader it
reads for absent members and keeps them until it reads a field that is
present or the struct ends.

Depends on: foxglove/cdr#24

In this PR, we only return `undefined` for these fields, however the
XCDR spec states that non-optional members should return default values
for their types specified here:

<img width="580" alt="image"
src="https://github.com/foxglove/omgidl/assets/10187776/be2b8d00-c6d9-47a4-b357-03cbd17dbcca">

In the spirit of incremental delivery, this will be a followup PR and
ticket.

Addresses: FG-6436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants