{"record":{"id":"d6cca5d2fb7a398d","repo":"microsoft/semantic-kernel","slug":"no-properties-found-in-the-schema","errorCode":null,"errorMessage":"No properties found in the schema.","messagePattern":"No properties found in the schema\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/samples/demos/guided_conversations/guided_conversation/plugins/artifact.py","lineNumber":230,"sourceCode":"            clean_properties_str = clean_properties_str.replace(\"#/$defs/\", \"\")\n            return clean_properties_str\n\n        # If filter_one_field is provided, only get the schema for that one field\n        if filter_one_field:\n            if not self._is_valid_field(filter_one_field):\n                self.logger.error(f'Field \"{filter_one_field}\" is not a valid field in the artifact.')\n                raise ValueError(f'Field \"{filter_one_field}\" is not a valid field in the artifact.')\n            filtered_schema = {\"properties\": {filter_one_field: self.original_schema[\"properties\"][filter_one_field]}}\n            filtered_schema.update((k, v) for k, v in self.original_schema.items() if k != \"properties\")\n            schema = filtered_schema\n        else:\n            schema = self.original_schema\n\n        failed_fields = self.get_failed_fields()\n        properties = _clean_properties(schema, failed_fields)\n        if not properties:\n            self.logger.error(\"No properties found in the schema.\")\n            raise ValueError(\"No properties found in the schema.\")\n\n        types_schema = schema.get(\"$defs\", {})\n        custom_types = []\n        for type_name, type_info in types_schema.items():\n            if f\"'type': '{type_name}'\" in properties:\n                clean_schema = _clean_properties(type_info, [])\n                if clean_schema != \"{}\":\n                    custom_types.append(f\"{type_name} = {clean_schema}\")\n\n        if custom_types:\n            explanation = f\"If you wanted to create a {type_name} object, for example, you would make a JSON object \\\nwith the following keys: {', '.join(types_schema[type_name]['properties'].keys())}.\"\n            custom_types_str = \"\\n\".join(custom_types)\n            return f\"\"\"{properties}\n\nHere are the definitions for the custom types referenced in the artifact schema:\n{custom_types_str}\n","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/samples/demos/guided_conversations/guided_conversation/plugins/artifact.py#L212-L248","documentation":"Raised by Artifact when, after cleaning the schema properties against the failed_fields exclusion list, no properties remain (_clean_properties returns an empty '{}'). This means every property was filtered out or the schema itself had no usable properties, so the artifact cannot present a schema to the model.","triggerScenarios":"Every field in the schema is listed in failed_fields; original_schema has no 'properties' key or an empty properties dict; the cleaning logic strips all keys due to $ref handling.","commonSituations":"All fields failed validation on a previous turn and were added to failed_fields; a malformed artifact schema; schema produced by a different code path that omits properties.","solutions":["Inspect failed_fields and original_schema['properties'] to see why all properties were filtered.","Reset/trim failed_fields so at least one valid field remains.","Ensure original_schema actually defines a non-empty properties map.","Re-derive the schema from a known-good artifact definition."],"exampleFix":"// before\nartifact.failed_fields = list(artifact.original_schema['properties'].keys())  # all fail\nartifact.get_schema()\n\n// after\nartifact.failed_fields = ['only_one_bad_field']\nartifact.get_schema()","handlingStrategy":"validation","validationCode":"props = set(artifact.original_schema.get('properties', {}).keys())\nfailed = set(artifact.failed_fields)\nif not (props - failed):\n    # nothing would survive cleaning; reset or raise informatively\n    artifact.failed_fields = list(failed - (failed - {next(iter(props))})) if props else []\n    raise ValueError('All fields are failed; cannot produce schema')","typeGuard":"def schema_has_surviving_properties(artifact) -> bool:\n    props = set(artifact.original_schema.get('properties', {}))\n    failed = set(artifact.failed_fields)\n    return bool(props - failed)","tryCatchPattern":"try:\n    schema = artifact.get_schema()\nexcept ValueError as ex:\n    if 'No properties' in str(ex):\n        artifact.failed_fields.clear()\n        schema = artifact.get_schema()","preventionTips":["Cap failed_fields so at least one property survives.","Reset failed_fields when starting a new conversation turn.","Validate the schema source has non-empty properties."],"tags":["guided-conversation","artifact","schema","validation"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}