scribe
scribe copied to clipboard
[Feature] Add support to `GetFromResponseFieldTag` for transformers and includes
- [x] I've read the documentation and I can't find details on how to achieve this.
When documenting an API, we can use @responseField
to document various response parameters. This currently only works when defined directly on controllers.
It would be nice if it could parse various transformer tags (@transformer
and @transformerCollection
), and include @responseField
definitions from them as well, e.g. @transformer \App\MyTransformer
. This would be useful for a scenario where you have many API methods that all use the same transformer, so you won't need to copy and paste the @responseField
annotations for every method.
For now I've ported this commit over into userland code: https://github.com/ScopeyNZ/laravel-apidoc-generator/commit/886ac9dcc449ae3209b8624c4427448f24cf0c03
You mean, @responseField
annotations in the transformer class' docblock? Yeah, I guess we could support that.🤔
ScopeyNZ/laravel-apidoc-generator@886ac9d
You're still on laravel-apidoc-generator? Interesting.😄
It would have to be via a user PR, though. I;m not big on the transformer aspect of things.
Yeah we are migrating. Fair enough!
I just committed a similar question with a detailed description. https://github.com/knuckleswtf/scribe/issues/596