I have a variant nested within a record type
public type MyVariantType = {
#type1;
#type2;
};
public type MyRecord = {
id: Nat;
recordtype: MyVariantType;
};
In my public actor function I share an interface to pass in a vector of records, so:
public func pass_records (in_records : [MyRecord]) : async () {
// do something
};
What object notation do I call the actor with in Javascript? I have tried the following.
[{"id":1, "recordtype": {"type1": true}}]
[{"id":1, "recordtype": {"type1": null}}]
[{"id":1, "recordtype": {"type1": {} }}]
[{"id":1, "recordtype": {"type1": true, "type2": false}}]
The first strategy seems to work when variants have some value to go with it.