Details
-
Task
-
Status: In Testing (View Workflow)
-
Critical
-
Resolution: Unresolved
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
-
- In Review
-
-
MDEV-30677 Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"
-
- In Review
-
-
MDEV-30689 JSON_SCHEMA_VALID for type=array return 1 for any string that starts with '['
-
- In Review
-
-
MDEV-30690 Server crashed on function JSON_SCHEMA_VALID with incorrect input json schema
-
- In Review
-
-
MDEV-30703 JSON_SCHEMA_VALID : Enum array must have at least one value
-
- In Review
-
-
MDEV-30704 JSON_SCHEMA_VALID: multipleOf must be greater than zero
-
- In Review
-
-
MDEV-30705 JSON_SCHEMA_VALID: schema with multipleOf for big value always return 1
-
- In Review
-
- 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() |
![]() |
Closed | Rucha Deodhar |
2.
|
Add Validation for Pattern and dependentRequired |
![]() |
Closed | Unassigned |