Skip to content

Commit

Permalink
Merge pull request #26 from idanya/fix-param-condition-check
Browse files Browse the repository at this point in the history
Fix parameter handling bug in AddParametersToRequest() function
  • Loading branch information
twest-bf authored Sep 13, 2024
2 parents 2877384 + 9fd1b78 commit 69de3ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ sj convert -u https://petstore.swagger.io/v2/swagger.json -o openapi.json`,
log.Error("Command not specified. See the --help flag for usage.")
}
},
Version: "1.8.0",
Version: "1.8.1",
}

func Execute() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (s SwaggerRequest) BuildDefinedRequests(client http.Client, method string,
// This whole function needs to be refactored/cleaned up a bit
func (s SwaggerRequest) AddParametersToRequest(op *openapi3.Operation) SwaggerRequest {
for _, param := range op.Parameters {
if param.Value == nil && param.Value.Schema.Ref == "" {
if param.Value == nil || param.Value.Schema.Ref == "" {
continue
} else if param.Value.In == "path" {
if param.Value.Schema != nil {
Expand Down

0 comments on commit 69de3ab

Please sign in to comment.