Details
-
Task
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
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
- Closed
-
MDEV-30677 Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"
- Closed
-
MDEV-30689 JSON_SCHEMA_VALID for type=array return 1 for any string that starts with '['
- Closed
-
MDEV-30690 Server crashed on function JSON_SCHEMA_VALID with incorrect input json schema
- Closed
-
MDEV-30703 JSON_SCHEMA_VALID : Enum array must have at least one value
- Closed
-
MDEV-30704 JSON_SCHEMA_VALID: multipleOf must be greater than zero
- Closed
-
MDEV-30705 JSON_SCHEMA_VALID: schema with multipleOf for big value always return 1
- Closed
-
MDEV-30976 Assertion `(length % 4) == 0' failed in my_lengthsp_utf32
- Open
-
MDEV-30977 Additional key values are not validating properly when using unevaluatedProperties with properties declared in subschemas
- Closed
-
MDEV-30995 JSON_SCHEMA_VALID is not validating case sensitive when using regex
- Closed
-
MDEV-31009 JSON_SCHEMA_VALID does not properly validate the maximum/minimum value of a number
- Closed
-
MDEV-31032 UBSAN|downcast of address X which does not point to an object of type 'Item_string' in sql/json_schema.cc
- Closed
-
MDEV-31599 Assertion `0' failed in Item_param::can_return_value from Item::val_json, UBSAN: member access within null pointer of type 'struct String' in sql/item_jsonfunc.cc
- Closed
- 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
-
MDEV-33640 Server crashes at my_hash_free
- Confirmed