Expand my Community achievements bar.

SOLVED

A draft 4 valid json cannot pass AEM forms schema validation

Avatar

Level 4

Hi, when I want to apply a valid json schema to AEM forms, I got this:

granite.js:272 POST http://localhost:4502/libs/fd/fm/gui/content/forms/guide/validate.html?jsonFilePath=%2Ftmp%2Ffd%2Ffm%2Fupload%2Fbncrfinal.schema.json_1620837349519&assetType=guide 420 (Enhance your Calm)

 

What's "Enhance your Calm" means? This json schema is valid:

{
"$schema": "http://json-schema.org/draft-04/schema",
"id": "http://localhost:4502/bncr.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"required": [
"latamInfo"
],
"properties": {
"latamInfo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo",
"required": [
"topMargin",
"clientInfo",
"inspectorInfo"
],
"title": "The latamInfo schema",
"type": "object",
"properties": {
"topMargin": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/topMargin",
"required": [
"operationNo",
"nasNo"
],
"title": "The topMargin schema",
"type": "object",
"properties": {
"operationNo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/topMargin/properties/operationNo",
"title": "The operationNo schema",
"maxLength": 70,
"required": [
true
],
"type": "string"
},
"reportNo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/topMargin/properties/reportNo",
"title": "The reportNo schema",
"maxLength": 70,
"type": "string"
},
"nasNo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/topMargin/properties/nasNo",
"title": "The nasNo schema",
"required": [
true
],
"type": "string"
}
},
"additionalProperties": true
},
"clientInfo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/clientInfo",
"required": [
"financialInstitution",
"clientName",
"cientNationalId"
],
"title": "The clientInfo schema",
"type": "object",
"properties": {
"financialInstitution": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/clientInfo/properties/financialInstitution",
"title": "The financialInstitution schema",
"const": "Banco Nacional de Costa Rica",
"type": "string"
},
"clientName": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/clientInfo/properties/clientName",
"title": "The clientName schema",
"required": [
true
],
"type": "string"
},
"cientNationalId": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/clientInfo/properties/cientNationalId",
"title": "The cientNationalId schema",
"required": [
true
],
"type": "string"
}
},
"additionalProperties": true
},
"inspectorInfo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/inspectorInfo",
"required": [
"Name",
"Company",
"telephone",
"email"
],
"title": "The inspectorInfo schema",
"type": "object",
"properties": {
"Name": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/inspectorInfo/properties/Name",
"title": "The Name schema",
"required": [
true
],
"type": "string"
},
"Company": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/inspectorInfo/properties/Company",
"title": "The Company schema",
"required": [
true
],
"type": "string"
},
"telephone": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/inspectorInfo/properties/telephone",
"title": "The telephone schema",
"pattern": "",
"type": "integer"
},
"email": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/inspectorInfo/properties/email",
"title": "The email schema",
"required": [
true
],
"type": "string"
}
},
"additionalProperties": true
},
"collateral": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral",
"required": [
"collateralNo",
"collateralDesc",
"provinceCode",
"province",
"countyCode",
"county",
"districtCode",
"district",
"exactAddress",
"typeOfGood",
"propertyId",
"eastCoordinate",
"northCoordinate"
],
"title": "The collateral schema",
"type": "object",
"properties": {
"collateralNo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/collateralNo",
"required": [
true
],
"title": "The collateralNo schema",
"type": "string"
},
"collateralDesc": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/collateralDesc",
"maxLength": 75,
"required": [
true
],
"title": "The collateralDesc schema",
"type": "string"
},
"provinceCode": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/provinceCode",
"maximum": 7,
"minimum": 1,
"required": [
true
],
"title": "The provinceCode schema",
"type": "integer"
},
"province": {
"description": "An explanation about the purpose of this instance.",
"enum": [
"SJO",
"ALA",
"CAR",
"HER",
"GUA",
"PUN",
"LIM"
],
"id": "#/properties/latamInfo/properties/collateral/properties/province",
"required": [
true
],
"title": "The province schema",
"type": "string"
},
"countyCode": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/countyCode",
"maximum": 60,
"minimum": 1,
"title": "The countyCode schema",
"required": [
true
],
"type": "integer"
},
"county": {
"id": "#/properties/latamInfo/properties/collateral/properties/county",
"type": "string",
"title": "The county schema",
"description": "An explanation about the purpose of this instance."
},
"districtCode": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/districtCode",
"title": "The districtCode schema",
"maximum": 60,
"minimum": 1,
"required": [
true
],
"type": "integer"
},
"district": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/district",
"title": "The district schema",
"maxLength": 65,
"required": [
true
],
"type": "string"
},
"exactAddress": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/exactAddress",
"title": "The exactAddress schema",
"maxLength": 350,
"type": "string"
},
"typeOfGood": {
"description": "An explanation about the purpose of this instance.",
"enum": [
"Inmuebles",
"Muebles"
],
"id": "#/properties/latamInfo/properties/collateral/properties/typeOfGood",
"required": [
true
],
"title": "The typeOfGood schema",
"type": "string"
},
"propertyId": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/propertyId",
"title": "The propertyId schema",
"maxLength": 35,
"required": [
true
],
"type": "string"
},
"eastCoordinate": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/eastCoordinate",
"title": "The eastCoordinate schema",
"maxLength": 50,
"required": [
true
],
"type": "string"
},
"northCoordinate": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/northCoordinate",
"title": "The northCoordinate schema",
"maxLength": 50,
"required": [
true
],
"type": "string"
},
"originalAppraiser": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/originalAppraiser",
"title": "The originalAppraiser schema",
"maxLength": 50,
"type": "string"
},
"originalAppraisalValue": {
"id": "#/properties/latamInfo/properties/collateral/properties/originalAppraisalValue",
"type": "integer",
"title": "The originalAppraisalValue schema",
"description": "An explanation about the purpose of this instance."
},
"currencyType": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/collateral/properties/currencyType",
"title": "The currencyType schema",
"enum": [
"Colones",
"USD"
],
"type": "string"
}
},
"additionalProperties": true
},
"conclusions": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/conclusions",
"required": [
"question1",
"question2",
"question3",
"riskQuestion"
],
"title": "The conclusions schema",
"type": "object",
"properties": {
"question1": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/conclusions/properties/question1",
"title": "The question1 schema",
"required": [
true
],
"type": "boolean"
},
"question2": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/conclusions/properties/question2",
"title": "The question2 schema",
"required": [
true
],
"type": "boolean"
},
"question3": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/conclusions/properties/question3",
"title": "The question3 schema",
"required": [
true
],
"type": "boolean"
},
"riskQuestion": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/conclusions/properties/riskQuestion",
"title": "The riskQuestion schema",
"required": [
true
],
"type": "boolean"
},
"alertCode": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/conclusions/properties/alertCode",
"title": "The alertCode schema",
"enum": [
"1 Descuido en edificaciones (problemas de manteniemiento externo)",
"2 Propiedad con maleza",
"3 Mala delimitación de la propiedad",
"4 Cliente no dejó acercarse a la garantía",
"5 vivienda en alquiler (no habitada por el deudor)",
"6 Propiedad desocupada",
"7 Propiedad en venta",
"8 Daños de vandalismo",
"9 Presencia de precario",
"10 Problemas de deslizamiento o de suelos",
"11 Problemas de inundación",
"12 Río gana terreno a la propiedad",
"13 Invasión de la propiedad por parte de terceros",
"14 Existe infraestructura principal en otra propiedad que no está en garantía",
"15 Otra. Anotar en espacio de Observaciones"
],
"type": "string"
}
},
"additionalProperties": true
},
"currentCondition": {
"id": "#/properties/latamInfo/properties/currentCondition",
"type": "object",
"title": "The currentCondition schema",
"description": "An explanation about the purpose of this instance.",
"required": [
"recommendation"
],
"properties": {
"recommendation": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/currentCondition/properties/recommendation",
"title": "The recommendation schema",
"maxLength": 1000,
"type": "string"
}
},
"additionalProperties": true
},
"certification": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification",
"required": [
"professionalType",
"inspectionDate",
"reportSignDate",
"appraiserType",
"appraiserLicenceNo",
"lendorInspectorCode",
"nationalRegisterId",
"picture1",
"picture2"
],
"title": "The certification schema",
"type": "object",
"properties": {
"additionalInfo": {
"description": "An explanation about the purpose of this instance.",
"enum": [
"Anexo",
"image1",
"image2",
"texto"
],
"id": "#/properties/latamInfo/properties/certification/properties/additionalInfo",
"title": "The additionalInfo schema",
"maxItems": 4,
"type": "array",
"additionalProperties": true
},
"professionalType": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/professionalType",
"title": "The professionalType schema",
"enum": [
"Ing. Civil",
"Ing. Construcción",
"Arquitecto",
"Ing. Industrial",
"Ing. Mecánico",
"Ing. Electromecánico",
"Ing. Agrónomo",
"Ing. Forestal",
"Ing. Agrícola",
"Topógrafo"
],
"type": "string"
},
"validatePerson": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/validatePerson",
"title": "The validatePerson schema",
"maxLength": 65,
"type": "string"
},
"inspectionDate": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/inspectionDate",
"title": "The inspectionDate schema",
"required": [
true
],
"type": "string"
},
"reportSignDate": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/reportSignDate",
"title": "The reportSignDate schema",
"required": [
true
],
"type": "string"
},
"appraiserType": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/appraiserType",
"title": "The appraiserType schema",
"enum": [
"Perito Interno",
"Perito Externo CIA",
"Perito Externo CFIA"
],
"required": [
true
],
"type": "string"
},
"appraiserLicenceNo": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/appraiserLicenceNo",
"title": "The appraiserLicenceNo schema",
"maxLength": 20,
"required": [
true
],
"type": "string"
},
"lendorInspectorCode": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/lendorInspectorCode",
"title": "The lendorInspectorCode schema",
"maxLength": 7,
"required": [
true
],
"type": "string"
},
"nationalRegisterId": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/nationalRegisterId",
"title": "The nationalRegisterId schema",
"maxLength": 20,
"required": [
true
],
"type": "string"
},
"picture1": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/picture1",
"title": "The picture1 schema",
"const": "Fachada Principal",
"required": [
true
],
"type": "string"
},
"picture2": {
"description": "An explanation about the purpose of this instance.",
"id": "#/properties/latamInfo/properties/certification/properties/picture2",
"title": "The picture2 schema",
"const": "Entorno",
"required": [
true
],
"type": "string"
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@DavidZhang 

Thanks for sharing the artifacts!

I am able to replicate the issue in-house with AEM Forms 6.5.8.0 so seems to be a bug.

Please raise a support ticket with related details and we will discuss this issue further with Engineering.

View solution in original post

3 Replies

Avatar

Level 4

Also, we are on aem forms 6.5.8.

 

Avatar

Correct answer by
Employee Advisor

@DavidZhang 

Thanks for sharing the artifacts!

I am able to replicate the issue in-house with AEM Forms 6.5.8.0 so seems to be a bug.

Please raise a support ticket with related details and we will discuss this issue further with Engineering.

Avatar

Level 4

I found the schema error using some other software. I don't know how AEM is coded, at least you should let me know what's the error. I opened: E-000377877. My current question is I turned on trace for com.adobe.aem.formsndocuments.* and com.adobe.aemfd.service.*, still, I didn't see any error log telling me where exactly the schema error. Please help to share how to see the error log for the schema validation.