-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
feat: OpenAPI integration #984
base: master
Are you sure you want to change the base?
Conversation
Looks like a good start. I think the yaml also should contain a few other things:
|
9055d99
to
3e106d0
Compare
cfg for tests
3e106d0
to
ea48919
Compare
Hey @NexVeridian Can I help you finish this pr? |
@DenuxPlays yeah of course |
How can I help? Also just one Note to your pr description. |
thanks! this would be nice if possible: impl Routes {
/// .add_openapi(routes!(get_action, post_action))
pub fn add_openapi(mut self, method: UtoipaMethodRouter<AppContext>) -> Self {}
} any of the unchecked ones in the pr description would be great: |
@NexVeridian, let us know when it is ready for review. |
@kaplanelad this is ready for review I think everything looks good, except for the |
First, thank you so much for all the hard work! This feature is fantastic for us. Before starting the code review, I want to focus on the user journey when adding it to their project. I’ve gone through your documentation, and here’s my feedback: Creating a New TemplateI ran the command: LOCO_DEV_MODE_PATH="[PATH TO LOCAL LOCO]" loco new Updating Cargo.toml
Can you please adjust this to include the feature under
Implementing initial_openapi_spec as hookWhen I removed set_jwt_location_ctx, I encountered this panic:
Route DefinitionsWhen defining routes, I had to add Generator ImprovementsI think it would be better to add an Removing the Demo AppWe plan to remove the demo app from our repo. Please refer to the related issue. Could you please open a new repo and commit the loco new files to master (without open API implementation)? |
Hi @NexVeridian, instead of working on demo, please open a PR here with the implementation. |
Just one small thing I noticed. |
Also for the PaginationQuery there needs to be an derive(IntoParameters) |
9acc912
to
819b45e
Compare
related #855
TODO:
enable: true
since that's handled by the feature.merge(Redoc::with_url("/redoc", api.clone()))
openapi
into featureall_openapi
swagger-ui
redoc
scalar
SecurityAddon
impl Modify for SecurityAddon
somewhere, maybe with configsrc/tests_cfg/db.rs:86:1
src/tests_cfg/config.rs
test_from_folder_openapi()
utoipa::path
if possibleget
inget(get_action_openapi)
is still grabbed withroutes!(get_action_openapi)
AppContext
- check thatapi_router.routes(method.with_state::<AppContext>(()))
doesn't break the ctx with.layer
cargo test
is broken withJWT_LOCATION.get_or_init
,nextest
works correctlycargo loco generate controller --openapi
utoipa::path
routes!
macrocc @DenuxPlays