We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I try to validate an object like the example in the documentation. I get a JSON invalid error.
interface User { firstName: string; lastName: string; age?: number; } const schema: JSONSchemaObject = { properties: { firstName: { type: 'string' } as JSONSchemaString, lastName: { type: 'string' } as JSONSchemaString, age: { type: 'number' } as JSONSchemaNumeric }, required: ['firstName', 'lastName'] }; const user: User = { firstName: 'Foo', lastName: 'Bar }; this.localStorage.setItem('user', user).subscribe(() => {}); this.localStorage.getItem<User>('user', { schema }).subscribe(res => console.log(res));
Am I doing something wrong?
Tested with 7.2.0
The text was updated successfully, but these errors were encountered:
This scenario is tested, and the test is OK.
There is a missing ' after Bar in your code, is that normal?
'
Bar
const user: User = { firstName: 'Foo', lastName: 'Bar };
Sorry, something went wrong.
Ah my bad, but even with the the ', it is still giving JSON invalid. Don't really understand
Fixed in v5.3.2, v6.2.1 and v7.2.1.
@rfcheung Thanks for reporting. 👍
Is it possible this problem still continues ? (v9-beta1)
No, it's supposed to be fixed. If you found a bug, please file a new issue with a reproduction.
cyrilletuzi
No branches or pull requests
If I try to validate an object like the example in the documentation. I get a JSON invalid error.
Am I doing something wrong?
Tested with 7.2.0
The text was updated successfully, but these errors were encountered: