ValidateJson() show missing required properties only.

Description

Code:

<cfset schema = '{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Patient",
"description": "Patient of catalogue",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"genre": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"required": [
"name",
"doctor"
]
}'>

<cfset json = '{
"name": 11,
"genre": {
"code": 3
}
}'>

<cfset result = ValidateJson(json, schema, false)>

<cfdump var="#result#">

This code generates only one error:

Whereas the Validator Json Schema shows three errors:
(https://www.jsonschemavalidator.net/ 1)

Here discussion on forum:
https://dev.lucee.org/t/bug-or-incomplete-report-in-validatejson/7694

Environment

OS: Windows 10
Lucee Version: 5.3.7.4

Attachments

2

Activity

Pothys - MitrahSoft 
9 December 2020 at 10:35


I've checked this issue and already confirmed the issue replicated on lucee in FORUM.
So, once again I mention here. It throws an error like missing required properties only.
But, it didn’t show other errors. If we fix the initial error - property issue, it showing the remaining two errors instance type does not match any allowed primitive type at the same time.

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 4 December 2020 at 20:40
Updated 5 August 2022 at 09:03