Closed PriyaRamith closed 2 years ago
Hey @PriyaRamith Can you share the 'schema' you passed in the request's body? It would be great if you can elaborate more on the issue you faced.
Hi,
Yes sure. I am sharing you the schema and the schema data here.
Schema is below:
{ "schema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Testing", "description": "Testing Described", "definitions": { "simpleTypes": {
"stringArray": {
"type": "array",
"items": { "type": "integer" },
"uniqueItems": true,
"default": []
}
}
},
"type": "object",
"properties": {
"certificateID": {
"type": "integer"
},
"licenceNo": {
"type": "string"
},
"centerName": {
"type": "string"
},
"centerAddress": {
"type": "string"
}, "customerMobileNo": { "type": "string"
}, "puccNo": { "type": "string" }, "etcCenterId": { "type": "object" }, "fuelType": { "type": "string"
}, "vehicleNo": { "type": "string"
}, "model": { "type": "string" }, "engine": { "type": "string" }, "catalyst": { "type": "string" }, "testDate": { "type": "string", "format": "date" }, "validDate": { "type": "string", "format": "date"
}, "npMismatchFlag": { "type": "string" },
"testResult": {
"type": "string"
}, "vehicleInfoMismatchReason": { "type": "string" }, "modifiedBy": { "type": "string" }, "modifiedDate": { "type": "string", "format": "date" }, "certificateMode": { "type": "string" }, "eCertificatePath": { "type": "string" }, "vehicletype": { "type": "string" }, "testTime": { "type": "number" }, "rtoDetailsId": { "type": "string" }, "probeInsertionStatus": { "type": "string" }, "vehicleTypeMismatch": { "type": "string" }, "aiStatus": { "type": "string" }, "aiVehicleTypeStatus": { "type": "string" }, "aiVehicleNumberStatus": { "type": "string" },
"npOcrEdited": {
"type": "string"
}, "rcOcrEdited": { "type": "string" }, "testVideoNPFrameMismatch": { "type": "string" },
"testVideoNPFrameMismatchMessage": {
"type": "string"
}, "rcOcrEditedMessage": { "type": "string" }, "npOcrEditedMessage": { "type": "string" }, "monitoringSystem": { "type": "string" }, "monitorName": { "type": "string" }, "monitorPendingRequestStatus": { "type": "string" }, "probeStatusMonitoringFlag": { "type": "integer" }, "flagID":{ "type": "array", "items": { "$ref": "#/definitions/simpleTypes" } }
}
}
}
Sample schema data is below: { "space": "space:cord:4C8vkTNSeeKvWP48YW9RA1upEp34gecZrJNgjC83TtQPkTfs", "schema": "schema:cord:59SpXsyg8c8ugzNuoyMFtdH6MXYoHvQBoHW9PS9MzSWgJpZ1", "title": "Testing", "content": { "licenceNo": "null", "centerName": "ManipalETC", "centerAddress": "Manipal mds", "customerMobileNo": "9591756124", "puccNo": "PE00100263", "etcCenterId": { "etcCenterId": "A000001" }, "fuelType": "petrol", "vehicleNo": "KA20EG9998", "model": "2015", "engine": "4", "catalyst": "yes", "testDate": "null", "validDate": "2023-08-30", "npMismatchFlag": "0", "vehicleInfoMismatchReason": "--", "testResult": "Pass", "probeInsertionStatus": "--", "aiStatus": "--", "aiVehicleTypeStatus": "--", "aiVehicleNumberStatus": "--", "rtoDetailsId": "KA20", "rcOcrEdited": "true", "npOcrEdited": "false", "testVideoNPFrameMismatch": "1", "rcOcrEditedMessage": "RC OCR edited", "npOcrEditedMessage": "--", "vehicleTypeMismatch": "--", "monitorPendingRequestStatus": "0", "testVideoNPFrameMismatchMessage": "Number Plate mismatch in Testing video", "probeStatusMonitoringFlag": "0", "flagID": [ 6, 7 ] }
}
Here etcCenterId is an object and flagID is an array of integer value. When either of one as type the schema API is returning 400 response. If we change both as integers and string the schema api is returning 200 response code.
Could you please help us to solve this issue?
Thanks & Regards, Priyanka S
On Sun, 11 Sep, 2022, 4:04 pm Shivansh Goel, @.***> wrote:
Hey @PriyaRamith https://github.com/PriyaRamith Can you share the 'schema' you passed in the request's body? It would be great if you can elaborate more on the issue you faced.
— Reply to this email directly, view it on GitHub https://github.com/dhiway/cord-agent-app-v1/issues/9#issuecomment-1242935276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYJJ246DZS3EUIQMZAZUC5TV5WYR5ANCNFSM6AAAAAAQJJ2X7Y . You are receiving this because you were mentioned.Message ID: @.***>
Thanks for the details...
We need https://github.com/dhiway/cord.js/pull/23 to be published to get this resolved. Should be available in npmjs registry by tomorrow morning.
Also, please note, the SDK doesn't yet support the 'ref' model for new item types. Will share the changes required for your schema here.
use content of schema from this file
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Testing",
"description": "Testing Described 123456",
"$metadata": {
"version": "1.0.0"
},
"type": "object",
"properties": {
"certificateID": {
"type": "integer"
},
"licenceNo": {
"type": "string"
},
"centerName": {
"type": "string"
},
"centerAddress": {
"type": "string"
},
"customerMobileNo": {
"type": "string"
},
"puccNo": {
"type": "string"
},
"etcCenterId": {
"type": "object"
},
"fuelType": {
"type": "string"
},
"vehicleNo": {
"type": "string"
},
"model": {
"type": "string"
},
"engine": {
"type": "string"
},
"catalyst": {
"type": "string"
},
"testDate": {
"type": "string",
"format": "date"
},
"validDate": {
"type": "string",
"format": "date"
},
"npMismatchFlag": {
"type": "string"
},
"testResult": {
"type": "string"
},
"vehicleInfoMismatchReason": {
"type": "string"
},
"modifiedBy": {
"type": "string"
},
"modifiedDate": {
"type": "string",
"format": "date"
},
"certificateMode": {
"type": "string"
},
"eCertificatePath": {
"type": "string"
},
"vehicletype": {
"type": "string"
},
"testTime": {
"type": "number"
},
"rtoDetailsId": {
"type": "string"
},
"probeInsertionStatus": {
"type": "string"
},
"vehicleTypeMismatch": {
"type": "string"
},
"aiStatus": {
"type": "string"
},
"aiVehicleTypeStatus": {
"type": "string"
},
"aiVehicleNumberStatus": {
"type": "string"
},
"npOcrEdited": {
"type": "string"
},
"rcOcrEdited": {
"type": "string"
},
"testVideoNPFrameMismatch": {
"type": "string"
},
"testVideoNPFrameMismatchMessage": {
"type": "string"
},
"rcOcrEditedMessage": {
"type": "string"
},
"npOcrEditedMessage": {
"type": "string"
},
"monitoringSystem": {
"type": "string"
},
"monitorName": {
"type": "string"
},
"monitorPendingRequestStatus": {
"type": "string"
},
"probeStatusMonitoringFlag": {
"type": "integer"
},
"flagID":{
"type": "array"
}
}
}
and in the record content you were missing below fields:
"certificateID": 1234,
"modifiedBy": "---",
"modifiedDate": "1970-01-01",
"certificateMode": "--",
"eCertificatePath": "--",
"vehicletype": "--",
"testTime": 3,
"monitoringSystem": "--",
"monitorName": "--",
also "probeStatusMonitoringFlag" should be number, not string.
This should resolve the issue. Also when its 'date', please give date, instead of 'null'.
Fixed by dhiway/cord.js#23
Hi, I am facing issue in sending type object and array of integer in schema API. Could you please resolve this issue.