When using constrained path templates in google.api.http, the generator expands them into the OpenAPI URL verbatim. This ensures that the literal prefix remains in the URL and each wildcard becomes its own OpenAPI parameter. This is necessary because the proto field binds to the full matched substring.
If a single proto field expands into multiple wildcards, subsequent parameters are suffixed with _1, _2, etc. All synthetic parameters point back to the same underlying proto field, which the grpc-gateway runtime reconstructs from the full matched substring at request time.
| Proto template | OpenAPI URL |
|---|
/v1/{name} | /v1/{name} |
/v1/{name=shelves/*} | /v1/shelves/{name} |
/v1/{name=shelves/*/books/*} | /v1/shelves/{name}/books/{name_1} |
/v1/{name=files/**} | /v1/files/{name} |
| Proto template | OpenAPI URL | |
| ------------------------ | ------------------------- |
| `/v1/{name}` | `/v1/{name}` |
| `/v1/{name=shelves/*}` | `/v1/shelves/{name}` |
| `/v1/{name=shelves/*/books/*}` | `/v1/shelves/{name}/books/{name_1}` |
| `/v1/{name=files/**}` | `/v1/files/{name}` |