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

Route description #3

Closed
TatriX opened this issue Sep 24, 2019 · 3 comments
Closed

Route description #3

TatriX opened this issue Sep 24, 2019 · 3 comments

Comments

@TatriX
Copy link

TatriX commented Sep 24, 2019

It seems that route docs doesn't currently used to generate route descriptions.
Am I missing anything?

Thanks for the project!

@GREsau
Copy link
Owner

GREsau commented Sep 28, 2019

That behaviour isn't currently implemented, but it's a good idea - I'll definitely keep it in mind for future enhancements

@leeola
Copy link

leeola commented Feb 28, 2020

I'm not familiar with Proc Macros at all, but I wrote up a POC here: master...leeola:fn-doc-support (because I too needed the feature).

That branch generates both a description and the summary from the docstring on a rocket route.

@GREsau Let me know if you'd like me to make a PR. There are a couple FIXME's. Note that I'm not immediately making the PR because it was a hastily, uninformed POC and there may be much better ways to implement it. Nevertheless, I figured I'd link my attempt in case it helps anyone.

@GREsau
Copy link
Owner

GREsau commented Apr 2, 2020

Sorry for the slow turnaround, I've just started looking at this.

I'm planning on copying schemars's behaviour, so if the first line of the doc comment begins with a # (i.e. if it's a markdown heading), then it will be used as the title (or summary in this case). The rest of the doc comment will be used as the description.

@GREsau
Copy link
Owner

GREsau commented Apr 2, 2020

Done - this is now implemented in rocket_okapi 0.4.1 and published to crates.io

@GREsau GREsau closed this as completed Apr 2, 2020
sd2k pushed a commit to sd2k/okapi that referenced this issue Apr 7, 2020
GREsau pushed a commit that referenced this issue Jun 12, 2021
Clippy Lints, Bump Darling
ralpha added a commit that referenced this issue Sep 12, 2021
- Added feature flag for `secrets`
(Re-exposing Rocket feature flag)
- Added support for Request Guards
and Security Scheme
(aka Authentication and Authorization) (Closes: #47, #9, #3)
- Added support for new `FromRequest`
  types (implemented `OpenApiFromRequest`).
- Added `OpenApiFromRequest` derive macro.
- Added `map!` macro for easy creation of `okapi::Map` objects.
- Change `OAuthFlows` to better represent the different flows and allowed values within them.
- Fixed casing in `SecuritySchemeData`.
@ralpha ralpha mentioned this issue Sep 12, 2021
ralpha added a commit that referenced this issue Sep 12, 2021
- Added feature flag for `secrets`
(Re-exposing Rocket feature flag)
- Added support for Request Guards
and Security Scheme
(aka Authentication and Authorization) (Closes: #47, #9, #3)
- Added support for new `FromRequest`
  types (implemented `OpenApiFromRequest`).
- Added `OpenApiFromRequest` derive macro.
- Added `map!` macro for easy creation of `okapi::Map` objects.
- Change `OAuthFlows` to better represent the different flows and allowed values within them.
- Fixed casing in `SecuritySchemeData`.
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

No branches or pull requests

3 participants