[
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "number"
					}
				},
				"required": [ "foo" ]
			},
			{
				"type": "object",
				"properties": {
					"bar": {
						"type": "number"
					}
				},
				"required": [ "bar" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "number"
				},
				"bar": {
					"type": "number"
				}
			},
			"required": [ "bar", "foo" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "number"
					}
				}
			},
			{
				"type": "object",
				"properties": {
					"bar": {
						"type": "number"
					}
				}
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "number"
				},
				"bar": {
					"type": "number"
				}
			}
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string"
					}
				},
				"required": [ "foo" ]
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string",
						"pattern": "^[a-z]+$"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "string",
					"pattern": "^[a-z]+$"
				}
			},
			"required": [ "foo" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string"
					}
				}
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string",
						"pattern": "^[a-z]+$"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "string",
					"pattern": "^[a-z]+$"
				}
			},
			"required": [ "foo" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": [ "string", "number" ]
					}
				}
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "string"
				}
			},
			"required": [ "foo" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string",
						"maxLength": 5
					}
				}
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "string",
					"maxLength": 5
				}
			},
			"required": [ "foo" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string",
						"maxLength": 5
					}
				}
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string",
						"maxLength": 3
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "string",
					"maxLength": 3
				}
			},
			"required": [ "foo" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string"
					}
				},
				"required": [ "foo" ]
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "number"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": null
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string",
						"pattern": "^foo$"
					}
				},
				"required": [ "foo" ]
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "string",
						"pattern": "^bar$"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
					"type": "string",
					"allOf": [
						{ "pattern": "^foo$" },
						{ "pattern": "^bar$" }
					]
				}
			},
			"required": [ "foo" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": [ "string", "number" ]
					}
				}
			},
			{
				"type": "object",
				"properties": {
					"foo": {
						"type": "array"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": null
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"slug": {
						"type": "string"
					}
				},
				"required": [ "slug" ],
				"additionalProperties": true
			},
			{
				"type": "object",
				"properties": {
					"active": {
						"type": "boolean",
						"const": true
					}
				},
				"required": [ "active" ]
			}
		],
		"expected": {
			"type": "object",
			"additionalProperties": true,
			"required": [ "active", "slug" ],
			"properties": {
				"slug": {
					"type": "string"
				},
				"active": {
					"type": "boolean",
					"const": true
				}
			}
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"additionalProperties": true
			}
		],
		"expected": {
			"type": "object",
			"additionalProperties": true
		}
	},
	{
		"schemas": [
			{
				"type": "object",
        "required": [ "foo" ],
        "properties": {
          "foo": {
            "type": "array",
            "enum": [ "foo", "baz" ]
          }
        }
			},
			{
				"type": "object",
        "required": [ "foo" ],
        "properties": {
          "foo": {
            "type": "array",
            "enum": [ "foo", "bar", "baz" ]
          }
        }
			}
		],
		"expected": {
      "type": "object",
      "additionalProperties": true,
      "required": [ "foo" ],
      "properties": {
        "foo": {
          "type": "array",
          "enum": [ "foo", "baz", "bar" ]
        }
      }
		}
	},
	{
		"schemas": [
			{
				"type": "object",
        "anyOf": [
          {
            "properties": {
              "foo": {
                "type": "string",
                "const": "abc"
              }
            },
            "required": [ "foo" ]
          },
          {
            "properties": {
              "bar": {
                "type": "string",
                "const": "def"
              }
            },
            "required": [ "bar" ]
          }
        ]
			},
			{
				"type": "object",
				"properties": {
					"baz": {
						"type": "string",
            "const": "ghi"
					}
				},
				"required": [ "baz" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
      "properties": {
        "baz": {
          "type": "string",
          "const": "ghi"
        }
      },
      "anyOf": [
        {
          "properties": {
            "foo": {
              "type": "string",
              "const": "abc"
            }
          },
          "required": [ "foo" ]
        },
        {
          "properties": {
            "bar": {
              "type": "string",
              "const": "def"
            }
          },
          "required": [ "bar" ]
        }
      ],
			"required": [ "baz" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
        "anyOf": [
          {
            "anyOf": [
              {
                "properties": {
                  "foo": {
                    "type": "string",
                    "const": "abc"
                  }
                },
                "required": [ "foo" ]
              },
              {
                "properties": {
                  "bar": {
                    "type": "string",
                    "const": "def"
                  }
                },
                "required": [ "bar" ]
              }
            ]
          }
        ]
			},
			{
				"type": "object",
				"properties": {
					"baz": {
						"type": "string",
            "const": "ghi"
					}
				},
				"required": [ "baz" ]
			}
		],
		"expected": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "baz": {
          "type": "string",
          "const": "ghi"
        }
      },
      "anyOf": [
        {
          "properties": {
            "foo": {
              "type": "string",
              "const": "abc"
            }
          },
          "required": [ "foo" ]
        },
        {
          "properties": {
            "bar": {
              "type": "string",
              "const": "def"
            }
          },
          "required": [ "bar" ]
        }
      ],
      "required": [ "baz" ]
		}
	},
	{
		"schemas": [
			{
				"type": "object",
        "anyOf": [
          {
            "properties": {
              "foo": {
                "type": "string"
              }
            },
            "required": [ "foo" ]
          },
          {
            "properties": {
              "bar": {
                "type": "number"
              }
            },
            "required": [ "bar" ]
          }
        ]
			},
			{
				"type": "object",
        "anyOf": [
          {
            "properties": {
              "baz": {
                "type": "string"
              }
            },
            "required": [ "baz" ]
          },
          {
            "properties": {
              "boo": {
                "type": "number"
              }
            },
            "required": [ "boo" ]
          }
        ]
			}
		],
		"expected": {
      "type": "object",
      "additionalProperties": true,
      "allOf": [
        {
          "anyOf": [
            {
              "properties": {
                "foo": {
                  "type": "string"
                }
              },
              "required": [ "foo" ]
            },
            {
              "properties": {
                "bar": {
                  "type": "number"
                }
              },
              "required": [ "bar" ]
            }
          ]
        },
        {
          "anyOf": [
            {
              "properties": {
                "baz": {
                  "type": "string"
                }
              },
              "required": [ "baz" ]
            },
            {
              "properties": {
                "boo": {
                  "type": "number"
                }
              },
              "required": [ "boo" ]
            }
          ]
        }
      ]
    }
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"foo": {
            "const": 1,
						"type": "number"
					}
				},
				"required": [ "foo" ]
			},
			{
				"type": "object",
				"properties": {
					"foo": {
            "const": 2,
						"type": "number"
					}
				},
				"required": [ "foo" ]
			}
		],
		"expected": {
			"type": "object",
      "additionalProperties": true,
			"properties": {
				"foo": {
          "const": 2,
					"type": "number"
				}
			},
			"required": [ "foo" ]
		}
	},
	{
		"schemas": [
      {
        "type": "object",
        "additionalProperties": false
      },
      {
        "type": "object",
        "additionalProperties": true
      }
		],
		"expected": {
			"type": "object",
      "additionalProperties": false
		}
	},
	{
		"schemas": [
      {
        "type": "object",
        "additionalProperties": true
      },
      {
        "type": "object",
        "additionalProperties": false
      }
		],
		"expected": {
			"type": "object",
      "additionalProperties": false
		}
	},
	{
		"schemas": [
      {
        "type": "object",
        "additionalProperties": true
      },
      {
        "type": "object",
        "additionalProperties": true
      }
		],
		"expected": {
			"type": "object",
      "additionalProperties": true
		}
	},
	{
		"schemas": [
      {
        "type": "object",
        "additionalProperties": true
      },
      {
        "type": "object",
        "additionalProperties": true,
        "anyOf": [
          {
            "type": "object"
          }
        ]
      }
		],
		"expected": {
			"type": "object",
      "additionalProperties": true
		}
	},
	{
		"schemas": [
      {
        "type": "object",
        "additionalProperties": true,
        "anyOf": [
          {
            "type": "object"
          }
        ]
      },
      {
        "type": "object",
        "additionalProperties": true
      }
		],
		"expected": {
			"type": "object",
      "additionalProperties": true
		}
	},
	{
		"schemas": [
      {
        "type": "object",
        "additionalProperties": true,
        "anyOf": [
          {
            "type": "object",
            "additionalProperties": true
          }
        ]
      },
      {
        "type": "object",
        "additionalProperties": true
      }
		],
		"expected": {
			"type": "object",
      "additionalProperties": true
		}
	},
	{
		"schemas": [
			{
				"type": "object",
				"properties": {
					"type": {
						"type": "string"
					},
					"data": {
						"type": "object"
					}
				},
				"required": [ "type", "data" ]
			},
			{
				"type": "object",
				"anyOf": [
					{
						"type": "object",
						"properties": {
							"name": {
								"type": "string"
							},
							"data": {
								"type": "object"
							}
						},
						"required": [ "name", "data" ]
					}
				]
			}
		],
		"expected": {
			"type": "object",
			"additionalProperties": true,
			"properties": {
				"type": {
					"type": "string"
				},
				"name": {
					"type": "string"
				},
				"data": {
					"type": "object"
				}
			},
			"required": [ "data", "name", "type" ]
		}
	}
]
