Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-lennon-whs committed Oct 26, 2020
1 parent 17083fb commit 447ed66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openapi2conv/openapi2_conv.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func ToV3Operation(swagger *openapi2.Swagger, components *openapi3.Components, p

func getParameterNameFromOldRef(ref string) string {
cleanPath := strings.TrimPrefix(ref, "#/parameters/")
pathSections := strings.Split(cleanPath, "/")
pathSections := strings.SplitN(cleanPath, "/", 1)

return pathSections[0]
}
Expand Down Expand Up @@ -246,7 +246,7 @@ func ToV3Parameter(components *openapi3.Components, parameter *openapi2.Paramete
parameter.ExtensionProps.Extensions = make(map[string]interface{})
}
parameter.ExtensionProps.Extensions["x-formData-name"] = parameter.Name
var required = []string{}
var required []string
if parameter.Required {
required = []string{parameter.Name}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ func formDataBody(bodies map[string]*openapi3.SchemaRef, reqs map[string]bool) *

func getParameterNameFromNewRef(ref string) string {
cleanPath := strings.TrimPrefix(ref, "#/components/schemas/")
pathSections := strings.Split(cleanPath, "/")
pathSections := strings.SplitN(cleanPath, "/", 1)

return pathSections[0]
}
Expand Down

0 comments on commit 447ed66

Please sign in to comment.