contributte / apitte

:wrench: An opinionated and enjoyable API framework based on Nette Framework. Supporting content negotiation, debugging, middlewares, attributes, annotations and loving openapi/swagger.
https://contributte.org/packages/contributte/apitte/
MIT License
61 stars 36 forks source link

Openapi extend configuration #17

Closed trejjam closed 6 years ago

trejjam commented 6 years ago

This PR provide possibility append Tag to a method Doc

f3l1x commented 6 years ago

Wow, nice job. Could give me some example of new annotation? And how does it look in swagger?

trejjam commented 6 years ago

These should be possible: @Controller\Method("GET", tag="Info") or @Controller\Method("GET", tags={"Info", "About"}).

I will pass a link to Swagger after CI completes its job.

Here is result https://efpa.scalesoft.cz/api/swagger (it is a staging and is available only at daytime)

f3l1x commented 6 years ago

I see. Looks great. But, we already have @Tag annotation. Which is quite general, you can use it for your own purpose or also for openapi. WDYT?

trejjam commented 6 years ago

For me was the @Tag quite confusing. It requires name, but intuitively I do not know what it should be. For some time I was thinking to create @MethodTag, but I left this idea for further development.

Maybe make name optional?

f3l1x commented 6 years ago

Tag name should be required, @Tag(Info), rather make the value optional. Don't you think? Value is usefule when you need to set some internal tag @Tag(name="resource", value="user/detail") and then implement it easily on your own security handler.

trejjam commented 6 years ago

Thanks for the hint, it sounds right. Take a look

f3l1x commented 6 years ago

Awesome.