Echo uses `param` struct tag for path params, not `path`
Hi there, and first: thanks for this cool project! I am looking forward to using it with a large Echo app I have.
One issue I've found is that spec seems to require the struct tag path to indicate a path param in a route. Echo uses the struct tag param for this purpose, not path. I can work around it by adding both path and param struct tags.
e.g. After fixing the issue in #39 you'll note that the /api/vi/users/:id route doesn't actually bind the ID into the request struct. This can be fixed by adding param:"id" to GetUserRequest here. It's kind of annoying to duplicate this info.
Could we make the name of the struct tag used for path params configurable? Something like option.WithPathParamTag("param").
It's possible there are other struct tag mismatches, but I haven't gone deeper than this one yet.
(I hacked a fix locally that adds a path struct tag to any struct that only has param before handing it off to spec generation, but I'm not sure that's a great approach.)
Thanks for your contribution to update the readme from echo adapter. This library is wrapper from openapi-go, and at openapi-go for now not support custom url path parameter tag, it only parse 'path' struct tag. I see it like annoying when use echo because we need add double tag ('path' and 'param'), i think to support custom option for custom url path tag name we need to contribute first at openapi-go and then adjust at spec.
I added option for custom parameter tag, likely it can use reflection feature to modify tag of struct, you can see the pull request at https://github.com/oaswrap/spec/pull/41. By default adapter like echo, fiber and gin has default option to custom path with default framework.
Cool, thanks for adding that. Looks similar to the hack I'm currently using as a work-around. Once this lands I'll give it a try!
Hi @overthink , i'm already create the release version, you can check at latest version (v0.3.6), thank you.