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

Improve variadic-length field specification #148

Open
OleksandrKvl opened this issue Apr 26, 2022 · 1 comment
Open

Improve variadic-length field specification #148

OleksandrKvl opened this issue Apr 26, 2022 · 1 comment

Comments

@OleksandrKvl
Copy link

Here, it says:

On the wire, length immediately precedes the data.

Which is 100% logical and correct. What bothers me is the next part Encoding specification. It says:

Variable length string is encoded as a composite type, consisting of a length sub field and data subfield

But it says nothing about the order of length and data fields, neither it does about the presence of other fields in that composite. I don't know if maintainers of this repo are connected to RealLogic and their implementation but they don't care about those things. They just take the length member's type and use it to decode the length on the wire. And for that composite type they generate the composite with fixed-length string of size 0. It doesn't look good.
I see no reason to relate to composite type just to get the length type. This introduces unneeded complication and confusion. Why can't <data> have its own set of attributes, one of which is lengthType and everything else that makes sense for var-data fields only? Currently, <data> has the same attributes as <field> but it's not correct. offset, presence, valueRef (and with my proposal type) doesn't make any sense for var-data field. And <type>s with length should always be treated as a fixed-size arrays.

@donmendelson
Copy link
Member

@OleksandrKvl you are correct that some of the field attributes are not useful for <data>. The documentation should be more specific. In the XML schema, a data attribute group could be a subset of a field attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants