Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pkg/protoanalysis): support HTTP rule parameter arguments #3592

Merged
merged 4 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- [#3559](https://github.com/ignite/cli/pull/3559) Bump network plugin version to `v0.1.1`
- [#3522](https://github.com/ignite/cli/pull/3522) Remove indentation from `chain serve` output

### Fixes

- [#3592](https://github.com/ignite/cli/pull/3592) fix(pkg/protoanalysis): support HTTP rule parameter arguments

## [`v0.27.0`](https://github.com/ignite/cli/releases/tag/v0.27.0)

### Features
Expand Down
6 changes: 5 additions & 1 deletion ignite/pkg/protoanalysis/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ func (b builder) elementsToHTTPRules(requestMessage *proto.Message, elems []prot
return
}

var urlParamRe = regexp.MustCompile(`(?m){(.+?)}`)
// Regexp to extract HTTP rule URL parameter names.
// The expression extracts parameter names defined within "{}".
// Extra parameter arguments are ignored. These arguments are normally
// defined after an "=", for example as "{param=**}".
var urlParamRe = regexp.MustCompile(`(?m){([^=]+?)(?:=.+?)?}`)

func (b builder) constantToHTTPRules(requestMessage *proto.Message, constant proto.Literal) (httpRules []HTTPRule) {
// find out the endpoint template.
Expand Down