Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30977

Additional key values are not validating properly when using unevaluatedProperties with properties declared in subschemas

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 11.1
    • 11.1.0
    • JSON
    • None

    Description

      The unevaluatedProperties object does not behave as expected when properties are declared in subschemas. Additional key values are not validating properly

      SET @unevaluatedProperties_schema= '{
        "allOf": [
          {
            "type": "object",
            "properties": {
              "name": { "type": "string" }
            }
          }
        ],
        "properties": {
          "type": { "enum": ["residential", "business"] }
        },
        "required": ["type"],
        "unevaluatedProperties": false
      }';
      

      Actual result

      11.0.2-opt>SELECT JSON_SCHEMA_VALID(@unevaluatedProperties_schema, '{"name": "joe", "type": "business", "dummy" : "hello" }');
      +-------------------------------------------------------------------------------------------------------------+
      | JSON_SCHEMA_VALID(@unevaluatedProperties_schema, '{"name": "joe", "type": "business", "dummy" : "hello" }') |
      +-------------------------------------------------------------------------------------------------------------+
      |                                                                                                           1 |
      +-------------------------------------------------------------------------------------------------------------+
      1 row in set (0.000 sec)
       
      11.0.2-opt>
      

      Expected result

      11.0.2-opt>SELECT JSON_SCHEMA_VALID(@unevaluatedProperties_schema, '{"name": "joe", "type": "business", "dummy" : "hello" }');
      +-------------------------------------------------------------------------------------------------------------+
      | JSON_SCHEMA_VALID(@unevaluatedProperties_schema, '{"name": "joe", "type": "business", "dummy" : "hello" }') |
      +-------------------------------------------------------------------------------------------------------------+
      |                                                                                                           0 |
      +-------------------------------------------------------------------------------------------------------------+
      1 row in set (0.000 sec)
       
      11.0.2-opt>
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.