guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
483 stars 173 forks source link

Type 'string' is not assignable to type 'TSchemaPropertyType | undefined' #459

Open dvelazquez1282 opened 1 year ago

dvelazquez1282 commented 1 year ago

Hi. I have started to use this library and I am trying to use the doc example in my project but I receive this error:

Type '{ properties: { email: { type: string; description: string; format: string; widget: string; }; }; }' is not assignable to type 'ISchema'. Types of property 'properties' are incompatible. Type '{ email: { type: string; description: string; format: string; widget: string; }; }' is not assignable to type 'IProperties'. Property 'email' is incompatible with index signature. Type '{ type: string; description: string; format: string; widget: string; }' is not assignable to type 'ISchema'. Types of property 'type' are incompatible. Type 'string' is not assignable to type 'TSchemaPropertyType | undefined'.

The scheme used is the same of the example:

mySchema = { properties: { email: { type: "string", description: "email", format: "email", }, password: { type: "string", description: "Password", }, rememberMe: { type: "boolean", default: false, description: "Remember me", }, }, required: ["email", "password", "rememberMe"], };

codycodes commented 1 year ago

We need to declare the object as ISchema type as mentioned in the referenced commit.