swift-url-routing icon indicating copy to clipboard operation
swift-url-routing copied to clipboard

BaseURLPrinter.parse(_:) does not include full base path

Open jacoblapworth opened this issue 2 years ago • 0 comments

Parsing a url that includes a path in the baseUrl fails with the example below:

let baseRouter = router.baseURL("https://google.com/v1")
let route = try! baseRouter.parse(URLRequestData(string: "https://google.com/v1/accounts")!)
Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: error: multiple failures occurred

error: unexpected input
 --> input:1:2-3
1 | /v1/accounts
  |  ^^ expected "accounts"
  |  ^^ expected "transactions"
  |  ^^ expected "income"
  |  ^^ expected "me"

Should this match the print method, or should parsing only include the actual path to be parsed?

jacoblapworth avatar Feb 08 '23 22:02 jacoblapworth