-
Notifications
You must be signed in to change notification settings - Fork 412
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
Document HandlerAspect in middleware.md #2729
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2729 +/- ##
=======================================
Coverage 64.56% 64.56%
=======================================
Files 148 148
Lines 8649 8649
Branches 1573 1573
=======================================
Hits 5584 5584
Misses 3065 3065 ☔ View full report in Codecov by Sentry. |
docs/dsl/middleware.md
Outdated
This can be achieved with the `HandlerAspect[Env, CtxOut]` type, which extends `Middleware[Env]`. | ||
This middleware produces a value of type `CtxOut` on each request, which the routing DSL will accept just like a path component: | ||
|
||
```scala |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to use the mdoc
as much as possible for snippet codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, though I don't know how much that adds here, since these snippets won't compile as written.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to make the code snippets maintainable by ensuring they can be compiled against the source code. So the "crash" modifier isn't helpful in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't use crash
but rather fail
(the former is for code that compiles but fails at runtime, the latter for code that won't compile in the first place).
In any case, I had to resort to the hack of a mdoc:invisible
block to declare some names.
Middlewares that return values for consumption by handlers (i.e.
HandlerAspect
s) need documenting.