Skip to content

JSON Schema #24

@gvenzl

Description

@gvenzl
CREATE TABLE jdocs (
 doc JSON VALIDATE
 '{
   "type": "object",
   "properties": {
    "id":
      {"type": "number"}
   }
  }'
);
SELECT * FROM staging
 WHERE doc IS JSON VALIDATE
 '{
    "type": "object",
    "properties": {
      "id":
        {"type": "number"}
    }
  }';
SELECT
 DBMS_JSON_SCHEMA
 .VALIDATE_REPORT(doc, schema)
FROM jdocs;

REPORT
-----------------------------
{
  "valid" : false,
  "errors" :
  [
    {
      "schemaPath" : "$.id",
      "instancePath" : "$",
      "code" : "JZN-00503",
      "error" : "invalid type found, actual: string, expected: number"
    }
  ]
}

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions