Cannot convert undefined or null to object with (assuming) invalid sync table getschema

I am getting this error when returning a schema from my dynamicOptions.getSchema. I have confirmed that nothing in my schema is null or undefined. I am looking to get assistance into why the schema is being rejected, and also raising the issue for undescriptive error message (likely due to some internal bug).

Error:

Request type getSyncTableSchemaMetadataRequest
Error Cannot convert undefined or null to object
Stack trace at processTicksAndRejections (node:internal/process/task_queues:96:5) 

Schema that breaks it is like:

{
  "includeUnknownProperties": false,
  "properties": {
    "Date": {
      "type": "string",
      "codaType": "date"
    },
    "Name": {
      "type": "string"
    },
    "People": {
      "type": "array",
      "items": {
        "type": "object",
        "codaType": "person"
      }
    }
  },
  "idProperty": "rowURL",
  "displayProperty": "rowURL",
  "featuredProperties": [
    "Date",
    "Name",
    "People"
  ],
  "type": "object"
}

Hi @loucadufault - I’m having trouble reproducing the issue exactly, but a few things jump out:

  • The rowURL property isn’t defined, but is referenced as the display and ID property.
  • The Person schema in the People property is incomplete. It needs to define an ID property that contains the email address of the user. Read more.

Thanks, helped me figure out the issue.

The rowURL property isn’t defined, but is referenced as the display and ID property.

I made a mistake when simplifying the object for pasting here but this prop was present.

The Person schema in the People property is incomplete. It needs to define an ID property that contains the email address of the user. Read more.

This was indeed the cause. I would propose that its worth looking into changing the validation code to not error out on such bad schemas.

I’m glad you were able to find the issue. I’m still having trouble trying to reproduce your error though, as I keep getting this more informative one instead:

Objects with codaType “person” require a “idProperty” property in the schema definition.

If you have the time, could you send along a complete snippet of code that leads to the original error?