You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we get the decoded data from Kaitai Compiler Generated go files it shows allowed integer values like 0,1,2,3 but we want its corresponding string value like reverse, nominal, unknown and spare respectively.
As per my understanding, this is default behavior of kaitai. When Kaitai Struct generates code, it typically uses integer values for enum types to maintain efficiency and simplicity in the binary representation. When these values are serialized into JSON, they remain as integers because the generated code does not automatically convert them to their corresponding string representations.
Kindly confirm above behavior. Also suggest some way to convert them to their corresponding string representations using Kaitai.
How to achieve such conversion in Kaitai?
The text was updated successfully, but these errors were encountered:
Consider below defined enum in ksy file where key(integer)-value(string) is defined
When we get the decoded data from Kaitai Compiler Generated go files it shows allowed integer values like 0,1,2,3 but we want its corresponding string value like reverse, nominal, unknown and spare respectively.
As per my understanding, this is default behavior of kaitai. When Kaitai Struct generates code, it typically uses integer values for enum types to maintain efficiency and simplicity in the binary representation. When these values are serialized into JSON, they remain as integers because the generated code does not automatically convert them to their corresponding string representations.
Kindly confirm above behavior. Also suggest some way to convert them to their corresponding string representations using Kaitai.
How to achieve such conversion in Kaitai?
The text was updated successfully, but these errors were encountered: