0
votes
{
  "alert_details": {
    "event_date": "2021-04-26T12:30:80Z",
    "camount": "789",
    "profile": {
        "name": {
           "first_name": "xxxx",
           "last_name": "xxxx",
           "middle_name": "xxx"
        }
    },
    "check_cash_date": "2021-04-26",
    "profile_address": {
      "name": "xxxxx",
      "street_address": "xxxxxx",
      "city": "xxxx",
      "state": "CA",
      "zip_code": "90021"
    },
   "alert_id": {
      "id": "abc123",
      "subject": "abc123",
      "abc_id": "abc123"
    }
  },
  "alert_sub_type": "check change",
  "alert_type": "change",
  "provider": "ABCD",
  "view_date": "2020-11-03T10:15:30Z",
  "status": "Read"
}

and

{
  "alert_details": {
    "event_date": "2020-11-03T10:15:30Z",
    "account_number": "*********xxx",
    "check_start_number": "2",
    "myprofile": {
        "name": {
           "first_name": "xxxx",
           "last_name": "xxxx",
           "middle_name": "M"
        }
    },
    "order_shipped_date": "2021-04-23",
    "myprofile_address": {
      "name": "xxxxx",
      "street_address": "xxxxx",
      "city": "xxxx",
      "state": "xxxx",
      "zip_code": "90021"
    },
    "quantity_ordered": "12",
    "alert_id": {
      "id": "abc123",
      "subject": "abc123",
      "abc_id": "abc123"
    }
  },
  "alert_sub_type": "review Check",
  "alert_type": "review",
  "provider": "abcd",
  "view_date": "2020-11-03T10:15:30Z",
  "status": "Read"
}

not understanding how to use the oneof and create a schema using this payload , I am new to write the schema using oneof , i searching some examples those were very simple structures

    {
        "description" : "schema validating people and vehicles",
        "type" : "object",
        "oneOf" : [{
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "alert_details": {
                    "$ref": "#/definitions/AlertDetails"
                },
                "alert_sub_type": {
                    "type": "string"
                },
                "alert_type": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "view_date": {
                    "type": "string",
                    "format": "date-time"
                },
                "status": {
                    "type": "string"
                }
            },
            "required": [
                "alert_details",
                "alert_sub_type",
                "alert_type",
                "provider",
                "status",
                "view_date"
            ],
            "title": "Welcome1"
        },
        "AlertDetails": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "event_date": {
                    "type": "string"
                },
                "camount": {
                    "type": "string",
                    "format": "integer"
                },
                "profile": {
                    "$ref": "#/definitions/Profile"
                },
                "check_cash_date": {
                    "type": "string",
                    "format": "date"
                },
                "profile_address": {
                    "$ref": "#/definitions/ProfileAddress"
                },
                "alert_id": {
                    "$ref": "#/definitions/AlertID"
                }
            },
            "required": [
                "alert_id",
                "camount",
                "check_cash_date",
                "event_date",
                "profile",
                "profile_address"
            ],
            "title": "AlertDetails"
        },
        "AlertID": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "id": {
                    "type": "string"
                },
                "subject": {
                    "type": "string"
                },
                "abc_id": {
                    "type": "string"
                }
            },
            "required": [
                "abc_id",
                "id",
                "subject"
            ],
            "title": "AlertID"
        },
        "Profile": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "$ref": "#/definitions/Name"
                }
            },
            "required": [
                "name"
            ],
            "title": "Profile"
        },
        "Name": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "first_name": {
                    "type": "string"
                },
                "last_name": {
                    "type": "string"
                },
                "middle_name": {
                    "type": "string"
                }
            },
            "required": [
                "first_name",
                "last_name",
                "middle_name"
            ],
            "title": "Name"
        },
        "ProfileAddress": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string"
                },
                "street_address": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                },
                "zip_code": {
                    "type": "string",
                    "format": "integer"
                }
            },
            "required": [
                "city",
                "name",
                "state",
                "street_address",
                "zip_code"
            ],
            "title": "ProfileAddress"
        },
   {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "clients": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Client"
                    }
                }
            },
            "required": [
                "clients"
            ],
            "title": "Welcome4"
        },
        "Client": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "device": {
                    "$ref": "#/definitions/Device"
                },
                "duid": {
                    "type": "string"
                },
                "platform": {
                    "type": "string"
                },
                "updatedDateTime": {
                    "type": "string",
                    "format": "date-time"
                },
                "version": {
                    "type": "string",
                    "format": "integer"
                }
            },
            "required": [
                "device",
                "duid",
                "platform",
                "updatedDateTime",
                "version"
            ],
            "title": "Client"
        },
        "Device": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "language": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "updatedDateTime": {
                    "type": "string",
                    "format": "date-time"
                }
            },
            "required": [
                "language",
                "name",
                "updatedDateTime"
            ],
            "title": "Device"
        }]
    }  

validation is not working for me, could someone help me with this schema, is there any online validation that I can use for this validation