You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why
I'm currently writing an API that runs on an AWS Lambda behind API Gateway. There's this really nice feature of API Gateways where you give it an openapi spec and when it invokes your lambda, it tells you the operation id that corresponds to this request. So you can easily write a router like so:
match request_context.operation_name.as_deref(){
route::MY_ID => foo(...)}
Currently, I have to keep the string id in sync between my const definition and the #[path] macro invocation. It would be nice to just have a single source of truth.
Is this something you'd be open to a PR for?
The text was updated successfully, but these errors were encountered:
TL;DR It would be useful if the
operation_id
option on the#[path]
macro could be a const variable instead of just a static string like so:Why
I'm currently writing an API that runs on an AWS Lambda behind API Gateway. There's this really nice feature of API Gateways where you give it an openapi spec and when it invokes your lambda, it tells you the operation id that corresponds to this request. So you can easily write a router like so:
Currently, I have to keep the string id in sync between my const definition and the
#[path]
macro invocation. It would be nice to just have a single source of truth.Is this something you'd be open to a PR for?
The text was updated successfully, but these errors were encountered: