def test_one_of_complex_definition_schema(self):
        serialized = salt.utils.yaml.safe_load(
            salt.utils.json.dumps(self.one_of_schema.serialize())
        )
        expected = {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Test OneOf Complex Definitions Schema",
            "type": "object",
            "properties": {
                "one_of_item": {
                    "oneOf": [
                        {"$ref": "#/definitions/ComplexSchemaItem"},
                        {"type": "string"},
                    ]
                }
            },
            "x-ordering": ["one_of_item"],
            "additionalProperties": False,
            "definitions": {
                "ComplexSchemaItem": {
                    "type": "object",
                    "title": "ComplexSchemaItem",
                    "properties": {
                        "thirsty": {
                            "type": "boolean",
                            "title": "Thirsty",
                            "description": "Are you thirsty?",
                        }
                    },
                }
            },
        }
        self.assertDictEqual(serialized, expected)