[MDEV-32752] JSON_SCHEMA_VALID: schema does not allow an array of objects Created: 2023-11-09  Updated: 2023-11-13

Status: Open
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 11.1.2
Fix Version/s: 11.1, 11.2

Type: Bug Priority: Major
Reporter: Henrique Spadim Assignee: Rucha Deodhar
Resolution: Unresolved Votes: 1
Labels: None
Environment:

A VM Ware machine with Linux 5.4.0-163-generic #180-Ubuntu 2023 x86_64 x86_64 x86_64 GNU/Linux
and
a Docker container



 Description   

Description

I'm not able to validate an array of objects.

Verification

I've tried to validate the following JSON schema with JSON_SCHEMA_VALID and it returned 0:

SET @schema='{"type":"object","properties":{"dummy":{"type":"array","items":{"type":"object","properties":{"info1":{"type":"string"},"info2":{"type":"string"},"info3":{"type":"string"}}}}}}';
 
SELECT JSON_SCHEMA_VALID(@schema, '{"dummy":[{"info1":"a","info2":"a","info3":"a"}]}') as "Dummy Teste";

Misc

I've tested with others JSON Schema validators in C#, JavasScript, Python3 and all of those gave me a correct answer. I've tried to find any test related to list of objects (func json test) but couldn't find any.


Generated at Thu Feb 08 10:33:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.