Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support optional parameters. #80

Merged
merged 1 commit into from
Aug 22, 2022
Merged

Support optional parameters. #80

merged 1 commit into from
Aug 22, 2022

Conversation

jbearer
Copy link
Member

@jbearer jbearer commented Aug 22, 2022

  • Removes a panic in request parsing when a formal parameter from
    another route pattern is not specified
  • Fixes some redundancy in route spec parsing
  • Removes RequestParam::required, as it is not used and not really
    meaningful (a parameter is required relative to a particular route
    pattern, but a route can have many patterns, and Tide already
    ensures that all the parameters for a given pattern are present
    before dispatching to that pattern)
  • Adds a new test

Closes #37

* Removes a panic in request parsing when a formal parameter from
  another route pattern is not specified
* Fixes some redundancy in route spec parsing
* Removes `RequestParam::required`, as it is not used and not really
  meaningful (a parameter is required relative to a particular route
  pattern, but a route can have many patterns, and Tide already
  ensures that all the parameters for a given pattern are present
  before dispatching to that pattern)
* Adds a new test

Closes #37
@jbearer jbearer requested a review from nyospe August 22, 2022 18:16
@jbearer jbearer self-assigned this Aug 22, 2022
}))
})
.collect::<Result<_, _>>()?,
params: params.into_values().collect(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

Copy link
Contributor

@nyospe nyospe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That duplication of effort in different forms at the end... what a twist.

@jbearer
Copy link
Member Author

jbearer commented Aug 22, 2022

Haha yeah...I was surprised when I saw that...and I wrote it!

@jbearer jbearer merged commit e081b97 into main Aug 22, 2022
@Ancient123 Ancient123 deleted the feat/opt-params branch November 29, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support optional route parameters
2 participants