@@ -174,7 +174,7 @@ func getOpenAPITools(t *openapi3.T, defaultHost, source, targetToolName string)
174
174
}
175
175
176
176
// Add the new arg to the tool's arguments
177
- tool .Arguments .Properties [param .Value .Name ] = openAPI3SchemaToHumaV2Schema (arg )
177
+ tool .Arguments .Properties [param .Value .Name ] = openAPI3SchemaToJSONSchema (arg )
178
178
179
179
// Check whether it is required
180
180
if param .Value .Required {
@@ -227,7 +227,7 @@ func getOpenAPITools(t *openapi3.T, defaultHost, source, targetToolName string)
227
227
}
228
228
// Unfortunately, the request body doesn't contain any good descriptor for it,
229
229
// so we just use "requestBodyContent" as the name of the arg.
230
- tool .Arguments .Properties ["requestBodyContent" ] = openAPI3SchemaToHumaV2Schema (arg )
230
+ tool .Arguments .Properties ["requestBodyContent" ] = openAPI3SchemaToJSONSchema (arg )
231
231
break
232
232
}
233
233
@@ -373,8 +373,8 @@ func parseServer(server *openapi3.Server) (string, error) {
373
373
return s , nil
374
374
}
375
375
376
- // openAPI3SchemaToHumaV2Schema converts an openapi3.Schema to a jsonschema.Schema
377
- func openAPI3SchemaToHumaV2Schema (schema * openapi3.Schema ) * jsonschema.Schema {
376
+ // openAPI3SchemaToJSONSchema converts an openapi3.Schema to a jsonschema.Schema
377
+ func openAPI3SchemaToJSONSchema (schema * openapi3.Schema ) * jsonschema.Schema {
378
378
if schema == nil {
379
379
return nil
380
380
}
@@ -471,22 +471,22 @@ func openAPI3SchemaToHumaV2Schema(schema *openapi3.Schema) *jsonschema.Schema {
471
471
result .Properties = make (map [string ]* jsonschema.Schema , len (schema .Properties ))
472
472
for name , propRef := range schema .Properties {
473
473
if propRef != nil && propRef .Value != nil {
474
- result .Properties [name ] = openAPI3SchemaToHumaV2Schema (propRef .Value )
474
+ result .Properties [name ] = openAPI3SchemaToJSONSchema (propRef .Value )
475
475
}
476
476
}
477
477
}
478
478
479
479
// Convert items
480
480
if schema .Items != nil && schema .Items .Value != nil {
481
- result .Items = openAPI3SchemaToHumaV2Schema (schema .Items .Value )
481
+ result .Items = openAPI3SchemaToJSONSchema (schema .Items .Value )
482
482
}
483
483
484
484
// Convert oneOf
485
485
if schema .OneOf != nil {
486
486
result .OneOf = make ([]* jsonschema.Schema , len (schema .OneOf ))
487
487
for i , oneOfRef := range schema .OneOf {
488
488
if oneOfRef != nil && oneOfRef .Value != nil {
489
- result .OneOf [i ] = openAPI3SchemaToHumaV2Schema (oneOfRef .Value )
489
+ result .OneOf [i ] = openAPI3SchemaToJSONSchema (oneOfRef .Value )
490
490
}
491
491
}
492
492
}
@@ -496,7 +496,7 @@ func openAPI3SchemaToHumaV2Schema(schema *openapi3.Schema) *jsonschema.Schema {
496
496
result .AnyOf = make ([]* jsonschema.Schema , len (schema .AnyOf ))
497
497
for i , anyOfRef := range schema .AnyOf {
498
498
if anyOfRef != nil && anyOfRef .Value != nil {
499
- result .AnyOf [i ] = openAPI3SchemaToHumaV2Schema (anyOfRef .Value )
499
+ result .AnyOf [i ] = openAPI3SchemaToJSONSchema (anyOfRef .Value )
500
500
}
501
501
}
502
502
}
@@ -506,14 +506,14 @@ func openAPI3SchemaToHumaV2Schema(schema *openapi3.Schema) *jsonschema.Schema {
506
506
result .AllOf = make ([]* jsonschema.Schema , len (schema .AllOf ))
507
507
for i , allOfRef := range schema .AllOf {
508
508
if allOfRef != nil && allOfRef .Value != nil {
509
- result .AllOf [i ] = openAPI3SchemaToHumaV2Schema (allOfRef .Value )
509
+ result .AllOf [i ] = openAPI3SchemaToJSONSchema (allOfRef .Value )
510
510
}
511
511
}
512
512
}
513
513
514
514
// Convert not
515
515
if schema .Not != nil && schema .Not .Value != nil {
516
- result .Not = openAPI3SchemaToHumaV2Schema (schema .Not .Value )
516
+ result .Not = openAPI3SchemaToJSONSchema (schema .Not .Value )
517
517
}
518
518
519
519
return result
0 commit comments