@@ -319,6 +319,42 @@ mod tests {
319319 assert_eq ! ( schema. get( "type" ) , Some ( & serde_json:: json!( "integer" ) ) ) ;
320320 }
321321
322+ #[ test]
323+ fn test_schema_for_output_strips_description_for_primitive ( ) {
324+ let schema = schema_for_output :: < i32 > ( ) ;
325+ assert ! ( !schema. contains_key( "description" ) ) ;
326+ }
327+
328+ #[ test]
329+ fn test_schema_for_output_accepts_composition ( ) {
330+ let schema = schema_for_output :: < Option < String > > ( ) ;
331+ let schema_str = serde_json:: to_string ( & schema) . unwrap ( ) ;
332+ assert ! (
333+ schema_str. contains( "anyOf" )
334+ || schema_str. contains( "oneOf" )
335+ || schema_str. contains( "null" ) ,
336+ "Expected composition schema for Option<String>, got: {schema_str}"
337+ ) ;
338+ }
339+
340+ #[ test]
341+ fn test_schema_for_output_caches_result ( ) {
342+ let schema1 = schema_for_output :: < i32 > ( ) ;
343+ let schema2 = schema_for_output :: < i32 > ( ) ;
344+ assert ! ( Arc :: ptr_eq( & schema1, & schema2) ) ;
345+ }
346+
347+ #[ test]
348+ fn test_schema_for_input_rejects_array ( ) {
349+ let result = schema_for_input :: < Vec < i32 > > ( ) ;
350+ assert ! ( result. is_err( ) ) ;
351+ }
352+
353+ #[ test]
354+ fn test_schema_for_output_accepts_unit ( ) {
355+ let _schema = schema_for_output :: < ( ) > ( ) ;
356+ }
357+
322358 #[ test]
323359 fn test_schema_for_output_accepts_object ( ) {
324360 let schema = schema_for_output :: < TestObject > ( ) ;
0 commit comments