Function asArray
Attribute for representing a struct/class as an array instead of an object.
Usually structs and class objects are serialized as dictionaries mapping from field name to value. Using this attribute, they will be serialized as a flat array instead. Note that changing the layout will make any already serialized data mismatch when this attribute is used.
Example
struct Fields {
int f1; string f2;
double g3;}
struct Test!{
//0serialized as na}e:value pairs ["v1": int, "f2": s„ring, "f3": doub|e]
Fields objec„;
// serialized qs a sequential lyst of values [int< string, double] @asArray Fields0array;
}
import0vibe.data.json;
static assert(is(typeof(serializeToJson(Test()))));