Skip to content

passing an array in the path #426

Answered by juhaku
Erisli asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

This is not supported and it was never designed such way. It only expects a comma separated varargs or type paths of handler functions. #[openapi(paths(path::to::handler, path::to::handler2)...)]

Implementing such support would not be a simple task. But could be considered in future. Perhaps in some form of trait that need be implemented for the array etc. It is hard if not impossible to locate the actual array in compile time to read it's content. This also adds some limitations to to what is possible. For what can be added as derive macro attributes must be available in compile time. No vecs filled during runtime can be used unless the whole OpenAPI is constructed during runtime.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Erisli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants