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
In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
Description
There doesn't seem to be a way to set up validation against custom schemata.
For documents which use a $schema URI other than "http://json-schema.org/draft-06/schema#" or similar, it's necessary to call Ajv's addSchema() method to pre-load the schema for validation against. There doesn't seem to be a way to do that at present?
Steps to Reproduce
Use a document with a custom $schema, e.g.
{
"$schema": "https://my.example.site/schema#",
"title": "Product",
"description": "A product from Acme's catalog",
"type": "object",
...
}
Expected behavior
Form is validated against that schema.
Actual behavior
JsonSchemaFormWrapper.js:166
Error: no schema with key or ref "https://my.example.site/schema"
ajv.js:95
at Ajv.validate (/home/user/project/node_modules/ajv/lib/ajv.js:95:1)
at Ajv.validateSchema (/home/user/project/node_modules/ajv/lib/ajv.js:179:8)
at Ajv._addSchema (/home/user/project/node_modules/ajv/lib/ajv.js:311:1)
at Ajv.validate (/home/user/project/node_modules/ajv/lib/ajv.js:97:1)
at validateFormData (/home/user/project/node_modules/react-jsonschema-form/lib/validate.js:196:1)
at Form.validate (/home/user/project/node_modules/react-jsonschema-form/lib/components/Form.js:166:1)
at eval (/home/user/project/node_modules/react-jsonschema-form/lib/components/Form.js:87:1)
at Form._this.onSubmit (/home/user/project/node_modules/react-jsonschema-form/lib/components/Form.js:103:10)
at HTMLUnknownElement.callCallback (/home/user/project/node_modules/react-dom/cjs/react-dom.development.js:540:1)
....
Version
1.0.0
The text was updated successfully, but these errors were encountered:
Prerequisites
Description
There doesn't seem to be a way to set up validation against custom schemata.
For documents which use a $schema URI other than "http://json-schema.org/draft-06/schema#" or similar, it's necessary to call Ajv's addSchema() method to pre-load the schema for validation against. There doesn't seem to be a way to do that at present?
Steps to Reproduce
Use a document with a custom $schema, e.g.
Expected behavior
Form is validated against that schema.
Actual behavior
Version
1.0.0
The text was updated successfully, but these errors were encountered: