grpc-ecosystem/grpc-gateway · error

unknown repeated path parameter separator: %s

Error message

unknown repeated path parameter separator: %s

What it means

SetRepeatedPathParamSeparator configures how repeated path parameters are serialized in URL templates. Only 'csv', 'pipes', 'ssv', and 'tsv' are accepted; any other name returns this error because the separator character is unknown.

Source

Thrown at internal/descriptor/registry.go:581

func (r *Registry) GetRepeatedPathParamSeparatorName() string {
	return r.repeatedPathParamSeparator.name
}

// SetRepeatedPathParamSeparator sets how path parameter repeated fields are
// separated. Allowed names are 'csv', 'pipe', 'ssv' and 'tsv'.
func (r *Registry) SetRepeatedPathParamSeparator(name string) error {
	var sep rune
	switch name {
	case "csv":
		sep = ','
	case "pipes":
		sep = '|'
	case "ssv":
		sep = ' '
	case "tsv":
		sep = '\t'
	default:
		return fmt.Errorf("unknown repeated path parameter separator: %s", name)
	}
	r.repeatedPathParamSeparator = repeatedFieldSeparator{
		name: name,
		sep:  sep,
	}
	return nil
}

// SetUseJSONNamesForFields sets useJSONNamesForFields
func (r *Registry) SetUseJSONNamesForFields(use bool) {
	r.useJSONNamesForFields = use
}

// GetUseJSONNamesForFields returns useJSONNamesForFields
func (r *Registry) GetUseJSONNamesForFields() bool {
	return r.useJSONNamesForFields
}

View on GitHub (pinned to a58a4436a3)

Solutions

  1. Use one of the supported names: 'csv', 'pipes', 'ssv', or 'tsv'
  2. Fix the spelling of the flag value in your generation script/Makefile
  3. Check tooling docs for the exact accepted strings and their case

Example fix

// before
reg.SetRepeatedPathParamSeparator("pipe")
// after
reg.SetRepeatedPathParamSeparator("pipes")
Defensive patterns

Strategy: validation

Validate before calling

var validSeparators = map[string]bool{"csv": true, "pipes": true, "ssv": true, "tsv": true}
if !validSeparators[name] {
    return fmt.Errorf("separator must be one of csv|pipes|ssv|tsv, got %q", name)
}
err := reg.SetRepeatedPathParamSeparator(name)

Prevention

When it happens

Trigger: Calling Registry.SetRepeatedPathParamSeparator(name) with a name outside the allowed set; via applyFlags when a CLI flag supplies a misspelled or unsupported separator name.

Common situations: Typo in generator flag (e.g. 'pipe' instead of 'pipes', 'comma' instead of 'csv'); copying flags from another tool that uses different separator vocabulary; uppercase input that is not normalized.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of grpc-ecosystem/grpc-gateway@a58a4436a3 (2026-09-02). Data as JSON: /api/errors/cf1b515e072ce7c8. Report an issue: GitHub.