guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dvelazquez1282 opened this issue · comments

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"], };

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