Skip to content

Commit

Permalink
godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Jan 15, 2025
1 parent 6135523 commit 07323fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/v2/api/grpcgateway/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func registerMethods[T transaction.Tx](mux *http.ServeMux, am appmanager.AppMana
// register in deterministic order. we do this because of the problem mentioned below, and different nodes could
// end up with one version of the handler or the other.
uris := slices.Sorted(maps.Keys(annotationToMetadata))

for _, uri := range uris {
queryMD := annotationToMetadata[uri]
// we need to wrap this in a panic handler because cosmos SDK proto stubs contains a duplicate annotation
Expand Down Expand Up @@ -263,6 +263,12 @@ func annotationsToQueryMetadata(annotations map[string]string) (map[string]query
return annotationToMetadata, nil
}

// extractWildcardKeyNames extracts the wildcard key names from the uri annotation.
//
// example:
// "/hello/{world}" -> []string{"world"}
// "/hello/{world}/and/{friends} -> []string{"world", "friends"}
// "/hello/world" -> []string{}
func extractWildcardKeyNames(uri string) []string {
matches := wildcardRegex.FindAllStringSubmatch(uri, -1)
var extracted []string
Expand Down

0 comments on commit 07323fd

Please sign in to comment.