Skip to content

Commit e5d78dc

Browse files
committed
rename function
Signed-off-by: Donnie Adams <[email protected]>
1 parent 7949063 commit e5d78dc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pkg/loader/openapi.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func getOpenAPITools(t *openapi3.T, defaultHost, source, targetToolName string)
174174
}
175175

176176
// 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)
178178

179179
// Check whether it is required
180180
if param.Value.Required {
@@ -227,7 +227,7 @@ func getOpenAPITools(t *openapi3.T, defaultHost, source, targetToolName string)
227227
}
228228
// Unfortunately, the request body doesn't contain any good descriptor for it,
229229
// 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)
231231
break
232232
}
233233

@@ -373,8 +373,8 @@ func parseServer(server *openapi3.Server) (string, error) {
373373
return s, nil
374374
}
375375

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 {
378378
if schema == nil {
379379
return nil
380380
}
@@ -471,22 +471,22 @@ func openAPI3SchemaToHumaV2Schema(schema *openapi3.Schema) *jsonschema.Schema {
471471
result.Properties = make(map[string]*jsonschema.Schema, len(schema.Properties))
472472
for name, propRef := range schema.Properties {
473473
if propRef != nil && propRef.Value != nil {
474-
result.Properties[name] = openAPI3SchemaToHumaV2Schema(propRef.Value)
474+
result.Properties[name] = openAPI3SchemaToJSONSchema(propRef.Value)
475475
}
476476
}
477477
}
478478

479479
// Convert items
480480
if schema.Items != nil && schema.Items.Value != nil {
481-
result.Items = openAPI3SchemaToHumaV2Schema(schema.Items.Value)
481+
result.Items = openAPI3SchemaToJSONSchema(schema.Items.Value)
482482
}
483483

484484
// Convert oneOf
485485
if schema.OneOf != nil {
486486
result.OneOf = make([]*jsonschema.Schema, len(schema.OneOf))
487487
for i, oneOfRef := range schema.OneOf {
488488
if oneOfRef != nil && oneOfRef.Value != nil {
489-
result.OneOf[i] = openAPI3SchemaToHumaV2Schema(oneOfRef.Value)
489+
result.OneOf[i] = openAPI3SchemaToJSONSchema(oneOfRef.Value)
490490
}
491491
}
492492
}
@@ -496,7 +496,7 @@ func openAPI3SchemaToHumaV2Schema(schema *openapi3.Schema) *jsonschema.Schema {
496496
result.AnyOf = make([]*jsonschema.Schema, len(schema.AnyOf))
497497
for i, anyOfRef := range schema.AnyOf {
498498
if anyOfRef != nil && anyOfRef.Value != nil {
499-
result.AnyOf[i] = openAPI3SchemaToHumaV2Schema(anyOfRef.Value)
499+
result.AnyOf[i] = openAPI3SchemaToJSONSchema(anyOfRef.Value)
500500
}
501501
}
502502
}
@@ -506,14 +506,14 @@ func openAPI3SchemaToHumaV2Schema(schema *openapi3.Schema) *jsonschema.Schema {
506506
result.AllOf = make([]*jsonschema.Schema, len(schema.AllOf))
507507
for i, allOfRef := range schema.AllOf {
508508
if allOfRef != nil && allOfRef.Value != nil {
509-
result.AllOf[i] = openAPI3SchemaToHumaV2Schema(allOfRef.Value)
509+
result.AllOf[i] = openAPI3SchemaToJSONSchema(allOfRef.Value)
510510
}
511511
}
512512
}
513513

514514
// Convert not
515515
if schema.Not != nil && schema.Not.Value != nil {
516-
result.Not = openAPI3SchemaToHumaV2Schema(schema.Not.Value)
516+
result.Not = openAPI3SchemaToJSONSchema(schema.Not.Value)
517517
}
518518

519519
return result

0 commit comments

Comments
 (0)