Skip to content

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

Open
@jacoblapworth

Description

@jacoblapworth

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jacoblapworth

        Issue actions

          BaseURLPrinter.parse(_:) does not include full base path · Issue #73 · pointfreeco/swift-url-routing