[ConnectorError] invalid output format: Schema validation error in path: [/: {"attributes":{},"re... did not match any of the specified OneOf schemas]

Hi Community,

I’m trying to write a provisioning policy for a Google Workspace source, but during the provisioning I obtain this error:

[ConnectorError] invalid output format: Schema validation error in path: [/: {"attributes":{},"re... did not match any of the specified OneOf schemas]

This is the provisioning policy:

{
    "name": "Account",
    "description": null,
    "usageType": "CREATE",
    "fields": [
        {
            "name": "objectType",
            "transform": {
                "type": "static",
                "attributes": {
                    "value": "user"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "familyName",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "lastname"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "givenName",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "firstname"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "displayName",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "displayName"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "primaryEmail",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "email"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "password",
            "transform": {
                "type": "rule",
                "attributes": {
                    "name": "Create Password"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "secret",
            "isMultiValued": false
        },
        {
            "name": "changePasswordAtNextLogin",
            "transform": {
                "type": "static",
                "attributes": {
                    "value": "true"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "isMailboxSetup",
            "transform": {
                "type": "static",
                "attributes": {
                    "country": {
                        "type": "static",
                        "attributes": {
                            "value": "$identity.getStringAttribute('countryIso2char')"
                        }
                    },
                    "value": "#if($country=='PL') false #else true #end"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "customSchemas.LumApps.LumApps_Sync",
            "transform": {
                "type": "static",
                "attributes": {
                    "ouIdentityType": {
                        "type": "static",
                        "attributes": {
                            "value": "$identity.getStringAttribute('ouIdentityType')"
                        }
                    },
                    "status": {
                        "type": "static",
                        "attributes": {
                            "value": "$identity.getStringAttribute('cloudLifecycleState')"
                        }
                    },
                    "value": "#if($ouIdentityType=='Employees' && ($status=='active' || $status=='future') ) YES #else NO #end"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "relations",
            "transform": {
                "type": "concat",
                "attributes": {
                    "values": [
                        "{\"value\":\"",
                        {
                            "type": "rule",
                            "attributes": {
                                "name": "Cloud Services Deployment Utility",
                                "operation": "getReferenceIdentityAttribute",
                                "uid": "manager",
                                "attributeName": "email"
                            }
                        },
                        "\",\"type\":\"manager\"}"
                    ]
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "phones",
            "transform": {
                "type": "concat",
                "attributes": {
                    "values": [
                        "{\"value\":\"",
                        {
                            "type": "static",
                            "attributes": {
                                "value": "$identity.getStringAttribute('workPhone')"
                            }
                        },
                        "\",\"type\":\"work\"}"
                    ]
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "externalIds",
            "transform": {
                "type": "concat",
                "attributes": {
                    "values": [
                        "{\"value\":\"CAAUTOBANK\\",
                        {
                            "type": "static",
                            "attributes": {
                                "value": "$identity.getStringAttribute('uid')"
                            }
                        },
                        "\",\"type\":\"organization\"}"
                    ]
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "addresses",
            "transform": {
                "type": "concat",
                "attributes": {
                    "values": [
                        "{\"type\":\"work\",\"formatted\":\"",
                        {
                            "type": "static",
                            "attributes": {
                                "value": "$identity.getStringAttribute('city')"
                            }
                        },
                        ",",
                        {
                            "type": "static",
                            "attributes": {
                                "value": "$identity.getStringAttribute('addressLine1')"
                            }
                        },
                        "\"}"
                    ]
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "organizations",
            "transform": {
                "type": "concat",
                "attributes": {
                    "values": [
                        "{\"name\":\"",
                        {
                            "type": "static",
                            "attributes": {
                                "value": "$identity.getStringAttribute('legalEmployer')"
                            }
                        },
                        "\",\"title\":",
                        {
                            "type": "static",
                            "attributes": {
                                "ouIdentityType": {
                                    "type": "static",
                                    "attributes": {
                                        "value": "$identity.getStringAttribute('ouIdentityType')"
                                    }
                                },
                                "value": "#if($ouIdentityType=='Service Identity') $ouIdentityType #else #if($ouIdentityType=='Consultants') Consultants #else Employee #end #end"
                            }
                        },
                        "\",\"department\":",
                        {
                            "type": "static",
                            "attributes": {
                                "value": "$identity.getStringAttribute('department')"
                            }
                        },
                        "\"}"
                    ]
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        }
]
}

Please note that I’ve tried to insert the [] in the multivalue attributes but it didn’t changed.

I’ve also tried to remove all the multivalue attribute, leaving only the first seven of the provisioning policy that are simple attributes and the error returned is the same.

Can you help me with this problem? Thanks in advance

1 Like

@l_pulignano ``` Please double check this fix, I have debug this issue based that I have providing this.

You are using type: string with JSON-formatted strings for fields like phones, addresses, relations, etc.
However, Google Workspace API expects these as proper JSON arrays or objects, not as stringified JSON blobs. ```

            "name": "phones",
            "transform": {
                "type": "concat",
                "attributes": {
                    "values": [
                        "{\"value\":\"",
                        {
                            "type": "static",
                            "attributes": {
                                "value": "$identity.getStringAttribute('workPhone')"
                            }
                        },
                        "\",\"type\":\"work\"}"
                    ]
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        }
		

Fixed json:

{
  "name": "phones",
  "type": "array",
  "isMultiValued": true,
  "transform": {
    "type": "static",
    "attributes": {
      "value": [
        {
          "value": "$identity.getStringAttribute('workPhone')",
          "type": "work"
        }
      ]
    }
  }
}   

Hi,

I’ve tried this solution but it doesn’t work. The type array doesn’t exist and set the attribute as multivalue didn’t change things. Also writing the value field as shown didn’t work.

thank you for update. I am sorry for providing that code which was not fixed the issue.

@l_pulignano -

It looks like a mismatch of your attributes that you are sending vs what you have defined in the Application Schema.

Could you share the schema details here.

Cheers!!!