{"record":{"id":"4fd4e6c05ecde1ba","repo":"spring-projects/spring-ai","slug":"unsupported-member-type","errorCode":null,"errorMessage":"Unsupported member type: ","messagePattern":"Unsupported member type: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"spring-ai-model/src/main/java/org/springframework/ai/util/json/schema/AbstractSpringAiSchemaModule.java","lineNumber":122,"sourceCode":"\t\tif (propertyAnnotation != null) {\n\t\t\treturn propertyAnnotation.required();\n\t\t}\n\n\t\tvar schemaAnnotation = member.getAnnotationConsideringFieldAndGetter(Schema.class);\n\t\tif (schemaAnnotation != null) {\n\t\t\treturn schemaAnnotation.requiredMode() == Schema.RequiredMode.REQUIRED\n\t\t\t\t\t|| schemaAnnotation.requiredMode() == Schema.RequiredMode.AUTO || schemaAnnotation.required();\n\t\t}\n\n\t\tNullness nullness;\n\t\tif (member instanceof FieldScope fs) {\n\t\t\tnullness = Nullness.forField(fs.getRawMember());\n\t\t}\n\t\telse if (member instanceof MethodScope ms) {\n\t\t\tnullness = Nullness.forMethodReturnType(ms.getRawMember());\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalStateException(\"Unsupported member type: \" + member);\n\t\t}\n\t\tif (nullness == Nullness.NULLABLE) {\n\t\t\treturn false;\n\t\t}\n\t\tif (KotlinDetector.isKotlinReflectPresent()\n\t\t\t\t&& KotlinDetector.isKotlinType(member.getDeclaringType().getErasedType())) {\n\t\t\t// Defer to KotlinModule for additional checks like default values\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.requiredByDefault;\n\t}\n\n\t/**\n\t * Options for customizing the behavior of the module.\n\t */\n\tpublic enum Option {\n","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/spring-ai-model/src/main/java/org/springframework/ai/util/json/schema/AbstractSpringAiSchemaModule.java#L104-L140","documentation":"Thrown by the nullness-checking schema module when the Jackson Member under inspection is neither a Field nor a Method scope, so its nullness cannot be computed while generating a JSON schema for a @Tool method.","triggerScenarios":"JSON schema generation for a tool's input type encounters a member kind the module doesn't handle — typically constructor parameters or exotic member types reached through Jackson introspection of the input record/class.","commonSituations":"Tool input types with unusual shapes (e.g. types whose introspection surfaces constructor-parameter members); custom Jackson modules altering member resolution; schema generation on types never intended for serialization.","solutions":["Simplify the tool's input type to plain fields/properties (POJO or record) that Jackson can introspect as fields/methods","Check for a custom Jackson introspection/module config changing Member kinds and remove it","Report the member type to Spring AI if it should be supported; work around by supplying an explicit JSON schema","Pin/upgrade the Spring AI version — this is likely an internal invariant hit, newer versions may handle the member kind"],"exampleFix":"// before (schema module chokes on exotic introspected member)\n@Tool String run(MyWeirdInternalType in) {...}\n// after — expose a simple input DTO\nrecord RunRequest(String name, int count) {}\n@Tool String run(RunRequest in) {...}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { schema = JsonSchemaGenerator.generateFor(type); }\ncatch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Unsupported member type\")) {\n        schema = /* hand-written fallback schema */;\n    }\n}","preventionTips":["Use simple records/POJOs as tool input types","Avoid custom Jackson introspection modules on tool input types","Upgrade Spring AI when hitting this on reasonable types — likely an internal invariant bug"],"tags":["jackson","json-schema","introspection"],"backgroundTag":"unsupported-operation","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}