Bug #106454 Use old JSON schema specification.
Submitted: 14 Feb 2022 12:07 Modified: 14 Feb 2022 14:40
Reporter: Вячеслав Ракицкий Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: JSON Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: json, json function, json_schema_validation

[14 Feb 2022 12:07] Вячеслав Ракицкий
In MySQL 8.0.28 use Draft 4 of the JSON Schema specification. Link to mysql documentation(https://dev.mysql.com/doc/refman/8.0/en/json-validation-functions.html). 

I have problems with json_shema_validation and exclusiveMinimum, becouse in new JSON schema specification parameter exclusiveMinimum works differently. Link to JSON Schema documentation (https://json-schema.org/understanding-json-schema/reference/numeric.html).

How to repeat:
set @sch = '{
	"title": "test json_schema_valid",
	"required": ["id_test"],
	"properties": {
	    "id_test": {
	      "type": "number",
	      "exclusiveMinimum ": 0

select json_schema_valid(@sch, '{"id_test": -1}');

This operation return true(1) but I expected false(0). 
This is the correct for old JSON Schema specification but not correct for new project becouse new project use new JSON Schema specification and newest mysql version.

Suggested fix:
I suggeste update JSON schema specification in new mysql version or create settings in which you can choose JSON schema specification.
[14 Feb 2022 14:40] MySQL Verification Team
Hi Mr. Rakickii,

Thank you for your feature request.

After careful analysis, we concluded that you are correct and that your feature request makes a lot of sense.

Verified as reported.