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 you use MakeType from your website, the generated Typescript proxies output contain a create function that never initialize the obj object.
So in the error message, the full object is always null...
Error: TypeError: Expected number at root.id but found:
undefined
Full object:
null
That's because there is a default value for the field parameter, so the if(!field) test is always false...
public static Create(d: any, field: string = 'root'): ExampleProxy {
if (!field) {
obj = d;
field = "root";
}
.....
}
You should remove the default value and make the parameter optional:
public static Create(d: any, field?: string): ExampleProxy {
if (!field) {
obj = d;
field = "root";
}
.....
}
The text was updated successfully, but these errors were encountered:
Hi,
When you use MakeType from your website, the generated Typescript proxies output contain a create function that never initialize the obj object.
So in the error message, the full object is always null...
That's because there is a default value for the field parameter, so the if(!field) test is always false...
You should remove the default value and make the parameter optional:
The text was updated successfully, but these errors were encountered: