Details
-
Type:
Task
-
Status: In Testing (View Workflow)
-
Priority:
Critical
-
Resolution: Unresolved
-
Fix Version/s: 11.1
-
Component/s: JSON
-
Labels:
Description
A great addition to MariaDB would be able to validate JSON schemas. MySQL already have this implemented as follows:
JSON_SCHEMA_VALID(schema,document)
Validates a JSON document against a JSON schema. Both schema and document are required. The schema must be a valid JSON object; the document must be a valid JSON document. Provided that these conditions are met: If the document validates against the schema, the function returns true (1); otherwise, it returns false (0).
Since MariaDB is great and it allows the use of UDFs and deterministic functions on constraints something like this would be awesome:
CREATE TABLE t1 (a JSON CHECK JSON_SCHEMA_VALID(schema, a)); |
or
CREATE TABLE t1 ( |
a JSON,
|
CONSTRAINT json_validation CHECK JSON_SCHEMA_VALID(schema, a) |
);
|
The word schema should be replaced by a string representing a valid JSON schema.
Attachments
Issue Links
- causes
-
MDEV-30287 JSON_SCHEMA_VALID returns incorrect result for type=number
-
- Open
-
- duplicates
-
MDEV-25934 JSON-Schema as Contraint on JSON-column
-
- Closed
-
- relates to
-
MDEV-17397 Implement JSON functions available in MySQL 8.0 but not MariaDB
-
- Open
-
-
MDEV-30219 Add more validation keywords for json schema
-
- Open
-
1.
|
Fix design for JSON_SCHEMA_VALID() |
![]() |
In Review | Alexey Botchkov |
2.
|
Add Validation for Pattern and dependentRequired |
![]() |
Open | Unassigned |