Nested routes? #137
Labels
enhancement
New feature or request
rocket-okapi
This affects the rocket-okapi crate
rocket-okapi-codegen
This affects the rocket-okapi-codegen crate
Hello, I've been trying to nest routes in a somewhat clean way, but I couldn't manage to do that with the proposed macros.
The idea is to include the routes from a module, adding a sub-path in the URI, and this module get more nested routes adding even more sub-path. All of that without having to specify all the routes at the top level (or second level by using
mount_endpoints_and_merged_docs
).It's a bit late here, so here is some code which might makes my explanation a bit more clear (hopefully), based on the
custom_schema
example:https://github.com/maximeborges/okapi/blob/ac9e23b6383591d8e9d69d742112679d163fa899/examples/nested/src/api/mod.rs
Basically in the main:
and in the
api
module, which haspost
andmessage
as sub-module:Is there a better way of doing that, or should I propose a PR to have some function/macro for that?
The text was updated successfully, but these errors were encountered: