Created by: ccouzens
Skip empty params when generating URLs
I have a route with many optional query parameters.
I observed that when they weren't specified, they were still included in
the routes, but without a value or the `&` character to separate them.
Running:
```bash
bash bash_keycloak/client.sh -v --oauth2-bearer "$access_token" --host "$api_host" --dry-run realmUsersGet realm=demo_realm2 email=foo+bar@baz.com username=foo
```
Would produce the route:
`http://localhost:8080/auth/admin/realms/demo_realm2/users?briefRepresentation=email=foo+bar@baz.comfirst=firstName=lastName=max=search=&username=foo`
After this change it produces the route:
`http://localhost:8080/auth/admin/realms/demo_realm2/users?email=foo+bar@baz.com&username=foo`
Note, I haven't written much bash, so I'm not yet used to its
conventions.
PR checklist
-
Read the contribution guidelines. -
Ran the shell script under ./bin/
to update Petstore sample so that CIs can verify the change. Note that./bin/bash-petstore.sh
and./bin/openapi3/bash-petstore.sh
change the same files. I have committed with the output of./bin/bash-petstore.sh
. -
Filed the PR against the correct branch: master
,4.1.x
,5.0.x
. Default:master
. -
Copied the technical committee to review the pull request if your PR is targeting a particular programming language. @frol @bkryza @kenjones-cisco
Description of the PR
See above