func (f finder) Operation(method, path string) (*spec.Operation, error) {
	for specPath, props := range f.doc.Spec().Paths.Paths {
		if f.matcher.Match(specPath, path) {
			var operation *spec.Operation

			switch strings.ToUpper(method) {
			case "DELETE":
				operation = props.Delete
			case "GET":
				operation = props.Get
			case "HEAD":
				operation = props.Head
			case "OPTIONS":
				operation = props.Options
			case "PATCH":
				operation = props.Patch
			case "POST":
				operation = props.Post
			case "PUT":
				operation = props.Put
			}

			if operation != nil {
				return operation, nil
			}
		}
	}
	return nil, ErrNotFound
}
// Operation returns a Operation object from the spec relative to a method and path
Operation returns a Operation object from the spec relative to a method and path
// Operation returns a Operation object from the spec relative to a method and path
func (f finder) Operation(method, path string) (*spec.Operation, error) {
	for specPath, props := range f.doc.Spec().Paths.Paths {
		if f.matcher.Match(specPath, path) {
			var operation *spec.Operation
			switch strings.ToUpper(method) {
			case "DELETE":
				operation = props.Delete
			case "GET":
				operation = props.Get
			case "HEAD":
				operation = props.Head
			case "OPTIONS":
				operation = props.Options
			case "PATCH":
				operation = props.Patch
			case "POST":
				operation = props.Post
			case "PUT":
				operation = props.Put
			}
			if operation != nil {
				return operation, nil
			}
		}
	}
	return nil, ErrNotFound
}
func ( f finder ) Operation ( method , path string ) ( * spec . Operation , error ) { for specPath , props := range f . doc . Spec ( ) . Paths . Paths { if f . matcher . Match ( specPath , path ) { var operation * spec . Operation switch strings . ToUpper ( method ) { case " " : operation = props . Delete case " " : operation = props . Get case " " : operation = props . Head case " " : operation = props . Options case " " : operation = props . Patch case " " : operation = props . Post case " " : operation = props . Put } if operation != nil { return operation , nil } } } return nil , ErrNotFound }
Operation returns a Operation object from the spec relative to a method and path
Operation returns a Operation object from the spec relative to a method and path