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

Model Accept-Patch header #3450

Merged
merged 2 commits into from May 31, 2020
Merged

Model Accept-Patch header #3450

merged 2 commits into from May 31, 2020

Conversation

cquiroz
Copy link
Member

@cquiroz cquiroz commented May 22, 2020

As part of modeling headers, here's Accept-Patch

@@ -120,6 +120,17 @@ object Header {
}
}

/** Helper trait that provides a default way of rendering the value provided a Renderer */
trait RecurringRenderer extends Recurring {
Copy link
Member Author

@cquiroz cquiroz May 22, 2020

Choose a reason for hiding this comment

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

This is equivalent to RecurringRenderable but for `Renderer

/** Helper trait that provides a default way of rendering the value provided a Renderer */
trait RecurringRenderer extends Recurring {
type Value
implicit val renderer: Renderer[Value]
Copy link
Member Author

@cquiroz cquiroz May 22, 2020

Choose a reason for hiding this comment

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

Any ideas on how to initialize this by default? My attempts ended poorly 😄

Copy link
Member

@rossabaker rossabaker May 30, 2020

Choose a reason for hiding this comment

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

Eager abstract values make me nervous. How about a def?

Copy link
Member Author

@cquiroz cquiroz May 30, 2020

Choose a reason for hiding this comment

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

sure

@@ -46,7 +46,7 @@ class HeadersSpec extends Http4sSpec {
Header("Accept-Patch", ""),
Header("Access-Control-Allow-Credentials", "")
)
headers.get(`Accept-Patch`).map(_.value) must beSome("")
headers.get(`Access-Control-Allow-Credentials`).map(_.value) must beSome("")
Copy link
Member Author

@cquiroz cquiroz May 22, 2020

Choose a reason for hiding this comment

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

I'm not sure about the meaning of this test

Copy link
Member

@rossabaker rossabaker May 30, 2020

Choose a reason for hiding this comment

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

I think it was just making sure that we could get headers when we had a key but not a full model. I don't think it's a great test, and what you did is fine.

cquiroz added 2 commits May 30, 2020
Signed-off-by: Carlos Quiroz <carlos.m.quiroz@gmail.com>
Signed-off-by: Carlos Quiroz <carlos.m.quiroz@gmail.com>
@cquiroz
Copy link
Member Author

cquiroz commented May 30, 2020

Rebased and fixed comment

Copy link
Member

@rossabaker rossabaker left a comment

👍

@cquiroz cquiroz merged commit f965cf9 into http4s:master May 31, 2020
10 checks passed
@cquiroz cquiroz deleted the accept-patchc branch May 31, 2020
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.

None yet

2 participants