We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e0efe1 commit b42bd9eCopy full SHA for b42bd9e
1 file changed
pkg/cli/mcp_schema.go
@@ -1,9 +1,6 @@
1
package cli
2
3
import (
4
- "fmt"
5
- "reflect"
6
-
7
"github.com/google/jsonschema-go/jsonschema"
8
)
9
@@ -30,15 +27,5 @@ import (
30
27
// OutputSchema: schema,
31
28
// }
32
29
func GenerateOutputSchema[T any]() (*jsonschema.Schema, error) {
33
- // Get the type of T
34
- var zero T
35
- typ := reflect.TypeOf(zero)
36
37
- // Use jsonschema.ForType to generate schema from Go type
38
- schema, err := jsonschema.ForType(typ, &jsonschema.ForOptions{})
39
- if err != nil {
40
- return nil, fmt.Errorf("failed to generate schema: %w", err)
41
- }
42
43
- return schema, nil
+ return jsonschema.For[T](nil)
44
}
0 commit comments