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

JSON_SCHEMA_VALID : Enum array must have at least one value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 11.1.1
    • JSON
    • None

    Description

      enum:

      The value of this keyword MUST be an array. This array SHOULD have at least one element. Elements in the array SHOULD be unique.

      https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.1.2

      So it is expected that JSON_SCHEMA_VALID for this schema returns warning:

      SET @schema = '{
                       "type":"array",
                        "enum": []
                      }';
      

      But actual result is:

      SELECT JSON_SCHEMA_VALID(@schema, '2');
      JSON_SCHEMA_VALID(@schema, '2')
      0
      SELECT JSON_SCHEMA_VALID(@schema, '[]');
      JSON_SCHEMA_VALID(@schema, '[]')
      0
      SELECT JSON_SCHEMA_VALID(@schema, null);
      JSON_SCHEMA_VALID(@schema, null)
      1
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.