File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ require (
88 github.com/mitchellh/mapstructure v1.4.1 // indirect
99 github.com/pkg/errors v0.8.1
1010 github.com/rs/zerolog v1.20.0
11+ github.com/sirupsen/logrus v1.8.1 // indirect
1112 github.com/spf13/cobra v1.1.1
1213 github.com/spf13/pflag v1.0.5
1314 github.com/spf13/viper v1.7.1
Original file line number Diff line number Diff line change @@ -163,6 +163,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb
163163github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 /go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc =
164164github.com/shurcooL/sanitized_anchor_name v1.0.0 /go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc =
165165github.com/sirupsen/logrus v1.2.0 /go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo =
166+ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE =
167+ github.com/sirupsen/logrus v1.8.1 /go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0 =
166168github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM =
167169github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d /go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc =
168170github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s =
@@ -257,6 +259,7 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
257259golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
258260golang.org/x/sys v0.0.0-20190606165138-5da285871e9c /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
259261golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
262+ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
260263golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884 =
261264golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
262265golang.org/x/text v0.3.0 /go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ =
Original file line number Diff line number Diff line change 66 "io/ioutil"
77 "os"
88 "path/filepath"
9+ "strings"
910
11+ "github.com/sirupsen/logrus"
1012 "gopkg.in/yaml.v3"
1113)
1214
@@ -88,6 +90,12 @@ func walkerMergeSpec(dst *OpenAPISpec) filepath.WalkFunc {
8890 return nil
8991 }
9092
93+ if ext := strings .ToLower (filepath .Ext (path )); ext != ".yaml" && ext != ".yml" {
94+ // skip because this is not a YAML file
95+ logrus .WithField ("path" , path ).Debug ("skipping non-YAML file" )
96+ return nil
97+ }
98+
9199 f , err := os .Open (path )
92100 if err != nil {
93101 return fmt .Errorf ("can not open spec file: %w" , err )
You can’t perform that action at this time.
0 commit comments