summaryrefslogtreecommitdiff
path: root/vendor/github.com/go-openapi/validate/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-openapi/validate/options.go')
-rw-r--r--vendor/github.com/go-openapi/validate/options.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/vendor/github.com/go-openapi/validate/options.go b/vendor/github.com/go-openapi/validate/options.go
index deeec2f2e..cfe9b0660 100644
--- a/vendor/github.com/go-openapi/validate/options.go
+++ b/vendor/github.com/go-openapi/validate/options.go
@@ -21,10 +21,29 @@ import "sync"
// NOTE: other options might be needed, for example a go-swagger specific mode.
type Opts struct {
ContinueOnErrors bool // true: continue reporting errors, even if spec is invalid
+
+ // StrictPathParamUniqueness enables a strict validation of paths that include
+ // path parameters. When true, it will enforce that for each method, the path
+ // is unique, regardless of path parameters such that GET:/petstore/{id} and
+ // GET:/petstore/{pet} anre considered duplicate paths.
+ //
+ // Consider disabling if path parameters can include slashes such as
+ // GET:/v1/{shelve} and GET:/v1/{book}, where the IDs are "shelve/*" and
+ // /"shelve/*/book/*" respectively.
+ StrictPathParamUniqueness bool
+ SkipSchemataResult bool
}
var (
- defaultOpts = Opts{ContinueOnErrors: false} // default is to stop validation on errors
+ defaultOpts = Opts{
+ // default is to stop validation on errors
+ ContinueOnErrors: false,
+
+ // StrictPathParamUniqueness is defaulted to true. This maintains existing
+ // behavior.
+ StrictPathParamUniqueness: true,
+ }
+
defaultOptsMutex = &sync.Mutex{}
)