Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions cmd/root_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package cmd
import (
"embed"
"encoding/json"
"errors"
"log/slog"
"net/url"
"os"
Expand All @@ -19,7 +18,7 @@ import (
"github.com/pb33f/wiretap/shared"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

var (
Expand Down Expand Up @@ -604,20 +603,14 @@ var (
}

// build a model
var errs []error
docModel, errs := doc.BuildV3Model()
if len(errs) > 0 && docModel != nil {
pterm.Warning.Printf("OpenAPI Specification loaded, but there %s %d %s detected...\n",
shared.Pluralize(len(errs), "was", "were"),
len(errs),
shared.Pluralize(len(errs), "issue", "issues"))
for _, e := range errs {
pterm.Warning.Printf("--> %s\n", e.Error())
}
docModel, docErr := doc.BuildV3Model()
if docErr != nil && docModel != nil {
pterm.Warning.Printf("OpenAPI Specification loaded, but there was an issue detected...\n")
pterm.Warning.Printf("--> %s\n", docErr.Error())
}
if len(errs) > 0 && docModel == nil {
if docErr != nil && docModel == nil {
pterm.Error.Printf("Failed to load / read OpenAPI specification.")
return errors.Join(errs...)
return docErr
}

docs = append(docs, shared.ApiDocument{Document: doc, DocumentName: contract})
Expand Down
2 changes: 1 addition & 1 deletion config/paths_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/pb33f/wiretap/shared"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestIsHardErrorsSet(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion daemon/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (ws *WiretapService) getValidatorForRequest(request *model.Request) *docume

for _, docValidator := range ws.documentValidators {
// Find the first path match between all provided specifications
pathItem, _, _ := paths.FindPath(request.HttpRequest, docValidator.docModel)
pathItem, _, _ := paths.FindPath(request.HttpRequest, docValidator.docModel, nil)

if pathItem != nil {
return &docValidator
Expand Down
58 changes: 30 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/pb33f/wiretap

go 1.23.0
go 1.25.0

require (
github.com/google/uuid v1.6.0
github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb // indirect
github.com/pb33f/harhar v0.0.0-20240111233202-e393c2a39a60
github.com/pb33f/libopenapi v0.21.12
github.com/pb33f/libopenapi-validator v0.4.5
github.com/pb33f/ranch v0.4.0
github.com/pterm/pterm v0.12.79
github.com/pb33f/harhar v0.0.0-20250707194835-e48f2c16e9c3
github.com/pb33f/libopenapi v0.30.3
github.com/pb33f/libopenapi-validator v0.9.4
github.com/pb33f/ranch v0.6.0
github.com/pterm/pterm v0.12.82
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
)

Expand All @@ -19,55 +19,57 @@ require (
atomicgo.dev/schedule v0.1.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/containerd/console v1.0.4 // indirect
github.com/containerd/console v1.0.5 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dprotaso/go-yit v0.0.0-20240618133044-5a0af90af097 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/go-stomp/stomp/v3 v3.1.2 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/go-stomp/stomp/v3 v3.1.3 // indirect
github.com/gobwas/glob v0.2.3
github.com/gookit/color v1.5.4 // indirect
github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.8.0
github.com/gookit/color v1.6.0 // indirect
github.com/gorilla/handlers v1.5.2
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.19 // indirect
github.com/mitchellh/mapstructure v1.5.0
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
github.com/subosito/gotenv v1.6.0 // indirect
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240815153524-6ea36470d1bd // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/text v0.32.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/fsnotify/fsnotify v1.8.0
github.com/fsnotify/fsnotify v1.9.0
github.com/json-iterator/go v1.1.12
go.yaml.in/yaml/v4 v4.0.0-rc.3
)

require (
github.com/basgys/goxml2json v1.1.1-0.20231018121955-e66ee54ceaad // indirect
github.com/clipperhouse/stringish v0.1.1 // indirect
github.com/clipperhouse/uax29/v2 v2.3.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/pb33f/jsonpath v0.7.0 // indirect
github.com/pb33f/ordered-map/v2 v2.3.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand Down
Loading