Skip to content

Conversation

mladedav
Copy link
Collaborator

Motivation

option-layer does not work with services that map the body type such as Trace.

The comment there also seems to be obsolete as tower::util::option_layer no longer maps the error types.

Solution

Now the body will be converted back right away. This will be what most users will most likely want to have happened though there may be advanced scenarios, where someone might want to map the body with another layer and then pay the price of converting to axum::body::Body just once. In that case, users can just use tower::util::option_layer.

@mladedav mladedav changed the title Dm/option layer body axum-extra: make option_layer map body type to axum::body::Body Sep 12, 2025
Copy link
Member

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Nice :)

@mladedav mladedav force-pushed the dm/option-layer-body branch 2 times, most recently from f4baeb8 to e1ee66a Compare September 14, 2025 16:33
@mladedav mladedav force-pushed the dm/option-layer-body branch from e1ee66a to 809dae7 Compare September 14, 2025 16:35
@mladedav mladedav merged commit 5c090dc into main Sep 14, 2025
18 checks passed
@mladedav mladedav deleted the dm/option-layer-body branch September 14, 2025 17:50
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.

2 participants