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