@@ -84,23 +84,14 @@ func getOpenAPITools(t *openapi3.T) ([]types.Tool, error) {
84
84
85
85
// Handle query, path, and header parameters
86
86
for _ , param := range operation .Parameters {
87
- // Marshal the param's schema to a string, and then into our JSONSchema struct
88
- raw , err := param .Value .Schema .Value .MarshalJSON ()
89
- if err != nil {
90
- return nil , err
91
- }
92
-
93
- arg := openapi3.Schema {}
94
- if err := json .Unmarshal (raw , & arg ); err != nil {
95
- return nil , err
96
- }
87
+ arg := param .Value .Schema .Value
97
88
98
89
if arg .Description == "" {
99
90
arg .Description = param .Value .Description
100
91
}
101
92
102
93
// Add the new arg to the tool's arguments
103
- tool .Parameters .Arguments .Properties [param .Value .Name ] = & openapi3.SchemaRef {Value : & arg }
94
+ tool .Parameters .Arguments .Properties [param .Value .Name ] = & openapi3.SchemaRef {Value : arg }
104
95
105
96
// Check whether it is required
106
97
if param .Value .Required {
@@ -135,23 +126,14 @@ func getOpenAPITools(t *openapi3.T) ([]types.Tool, error) {
135
126
}
136
127
bodyMIME = mime
137
128
138
- raw , err := content .Schema .Value .MarshalJSON ()
139
- if err != nil {
140
- return nil , err
141
- }
142
-
143
- arg := openapi3.Schema {}
144
- if err := json .Unmarshal (raw , & arg ); err != nil {
145
- return nil , err
146
- }
147
-
129
+ arg := content .Schema .Value
148
130
if arg .Description == "" {
149
131
arg .Description = content .Schema .Value .Description
150
132
}
151
133
152
134
// Unfortunately, the request body doesn't contain any good descriptor for it,
153
135
// so we just use "requestBodyContent" as the name of the arg.
154
- tool .Parameters .Arguments .Properties ["requestBodyContent" ] = & openapi3.SchemaRef {Value : & arg }
136
+ tool .Parameters .Arguments .Properties ["requestBodyContent" ] = & openapi3.SchemaRef {Value : arg }
155
137
break
156
138
}
157
139
0 commit comments