@@ -612,44 +612,15 @@ func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Sche
612612}
613613
614614func (s * SpecValidator ) validateParameters () * Result {
615- // - for each method, path is unique, regardless of path parameters
616- // e.g. GET:/petstore/{id}, GET:/petstore/{pet}, GET:/petstore are
617- // considered duplicate paths
618615 // - each parameter should have a unique `name` and `type` combination
619616 // - each operation should have only 1 parameter of type body
620617 // - there must be at most 1 parameter in body
621618 // - parameters with pattern property must specify valid patterns
622619 // - $ref in parameters must resolve
623620 // - path param must be required
624621 res := new (Result )
625- rexGarbledPathSegment := mustCompileRegexp (`.*[{}\s]+.*` )
626622 for method , pi := range s .expandedAnalyzer ().Operations () {
627- methodPaths := make (map [string ]map [string ]string )
628623 for path , op := range pi {
629- pathToAdd := pathHelp .stripParametersInPath (path )
630-
631- // Warn on garbled path afer param stripping
632- if rexGarbledPathSegment .MatchString (pathToAdd ) {
633- res .AddWarnings (pathStrippedParamGarbledMsg (pathToAdd ))
634- }
635-
636- // Check uniqueness of stripped paths
637- if _ , found := methodPaths [method ][pathToAdd ]; found {
638-
639- // Sort names for stable, testable output
640- if strings .Compare (path , methodPaths [method ][pathToAdd ]) < 0 {
641- res .AddErrors (pathOverlapMsg (path , methodPaths [method ][pathToAdd ]))
642- } else {
643- res .AddErrors (pathOverlapMsg (methodPaths [method ][pathToAdd ], path ))
644- }
645- } else {
646- if _ , found := methodPaths [method ]; ! found {
647- methodPaths [method ] = map [string ]string {}
648- }
649- methodPaths [method ][pathToAdd ] = path // Original non stripped path
650-
651- }
652-
653624 var bodyParams []string
654625 var paramNames []string
655626 var hasForm , hasBody bool
0 commit comments