Currently the metadata attribute argument will be used in a composite structure <Struct>AndMetadata that flattens the struct for deserialization purposes next to the metadata. This was initially done to try to free the developer from having to manually specify metadata fields and their usage only for deserialization.
However, this scheme makes it impossible to access this metadata by passing in just a <Struct>. The workaround is to set the metadata argument to an empty type and manually specify the metadata inside the struct.
Doing this in the macro would have the metadata next to the other fields and would also simplify the deserialization by removing the need for the composite structure.
Currently the metadata attribute argument will be used in a composite structure
<Struct>AndMetadatathat flattens the struct for deserialization purposes next to the metadata. This was initially done to try to free the developer from having to manually specify metadata fields and their usage only for deserialization.However, this scheme makes it impossible to access this metadata by passing in just a
<Struct>. The workaround is to set the metadata argument to an empty type and manually specify the metadata inside the struct.Doing this in the macro would have the metadata next to the other fields and would also simplify the deserialization by removing the need for the composite structure.