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

Middlewares: execution order + docs #156

Merged
merged 13 commits into from
Jan 11, 2024
Merged

Middlewares: execution order + docs #156

merged 13 commits into from
Jan 11, 2024

Conversation

LukeMathWalker
Copy link
Owner

@LukeMathWalker LukeMathWalker commented Jan 11, 2024

While documenting the execution order of middlewares, I realised that the existing implementation resulted in some unintuitive behaviour (i.e. a middleware would apply to all routes in the same Blueprint, even if the middleware was registered after a route).
This PR changes the behaviour to align with the user's intuition.

Internals

Refactorings lead to other refactorings: I had to change the internal representation of a Blueprint to fix the issue with middlewares. I took the opportunity to remove the internals module from pavex entirely. It is now in a separate crate, pavex_bp_schema, which is not exposed through pavex's public API. It is an (implicit) dependency of Blueprint::persist and Blueprint::load.

@LukeMathWalker LukeMathWalker merged commit 80b93d2 into main Jan 11, 2024
6 checks passed
@LukeMathWalker LukeMathWalker deleted the middleware-docs branch January 11, 2024 18:16
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.

1 participant