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
Describe the bug fieldOrder is added to all models and struct types stored within the models in models.gen.ts which I assume is necessary for querying torii. The current problem is that contracts.gen.ts references these for inputs, but fieldOrder should not be present otherwise there are deserialization errors.
The binding can add a type that removes fieldOrder (and from nested objects), or handle this is in the generation process.
models.gen.ts
export interface Adventurer {
fieldOrder: string[];
...fields
}
// Utility type to recursively remove fieldOrder from all nested objects
type RemoveFieldOrder<T> = T extends object
? Omit<
{
[K in keyof T]: T[K] extends object ? RemoveFieldOrder<T[K]> : T[K];
},
'fieldOrder'
>
: T;
// Create a new type without fieldOrder
type InputAdventurer = RemoveFieldOrder<Adventurer>;
Describe the bug
fieldOrder
is added to all models and struct types stored within the models inmodels.gen.ts
which I assume is necessary for querying torii. The current problem is thatcontracts.gen.ts
references these for inputs, butfieldOrder
should not be present otherwise there are deserialization errors.To Reproduce
or find the file here:
Current Behaviour
models.gen.ts
contracts.gen.ts
Expected behavior
The binding can add a type that removes
fieldOrder
(and from nested objects), or handle this is in the generation process.models.gen.ts
contracts.gen.ts
The text was updated successfully, but these errors were encountered: