Closed Ploppz closed 3 months ago
Hello,
I'm not sure but I think I faced the same issue.
Instead of
.service(
scope("/admin")
.route("/measurements/{measurement_id}",
delete().to(admin_delete_measurement),
))
Try this:
.service(
scope("/admin")
.service(resource("/measurements/{measurement_id}").route(delete().to(admin_delete_measurement)))
)
Thanks a lot, that helped!
I made a running example reproducing one of the API endpoints of my applications that generates a strange openapi.json. Code below.
The problem is firstly that it generates the wrong URI path:
/api/v1/admin/admin
. Expected would be/api/v1/admin/measurement/{measurement_id}
. Secondly, the swagger editor complains:main.rs
Cargo.toml
The generated
openapi.json
:Try it at https://editor.swagger.io/