You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Why make this change?
- Closes#3336
- `dab configure --runtime.rest.path "/api/v2"` (and the GraphQL
equivalent) failed with `contains one or more reserved characters`. The
path validator stripped the leading `/` and then rejected the whole
remainder using a regex where `/` is itself reserved, so any
multi-segment path was rejected even though routing supports them.
## What is this change?
- **Segment-aware validation:** Added
`RuntimeConfigValidatorUtil.DoesUriPathContainReservedChars`, which
splits the path (after the leading `/`) into `/`-separated segments and
validates each one. `/` is now permitted as a separator; empty segments
(leading/consecutive/trailing slashes) and reserved characters are still
rejected. The root path `/` stays valid.
- **Shared validator updated:** `TryValidateUriComponent` now uses the
helper, so REST, GraphQL, MCP, and base-route all accept multi-segment
paths while preserving existing error messages for genuinely invalid
input.
- **CLI parity:** `IsURIComponentValid` (used by `dab init`) now uses
the same segment-aware check.
- **Tests:** Updated existing E2E rows that asserted multi-segment paths
fail; added positive `/api/v2` cases and empty-segment/trailing-slash
failure cases across configure, init, and config-validation tests.
## How was this tested?
- [x] Integration Tests
- [x] Unit Tests
## Sample Request(s)
```bash
# Previously rejected, now accepted
dab configure --runtime.rest.path "/api/v2" --config test.json
dab configure --runtime.graphql.path "/api/v2" --config test.json
# Still rejected
dab configure --runtime.rest.path "/api//v2" --config test.json # empty segment
dab configure --runtime.rest.path "/api/" --config test.json # trailing slash
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Souvik Ghosh <souvikofficial04@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
0 commit comments