dhiway/cord-agent-app-v1

Issue in Schema API for sending type Object and Array of integer

Closed this issue · 5 comments

Hi,
I am facing issue in sending type object and array of integer in schema API.
Could you please resolve this issue.

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.

Thanks for the details...

We need dhiway/cord.js#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'.