We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon and Swagger

Hi,

Anyone can explain me how can I use swagger with phalcon please ? I didn't see any tutorials :/. Where should I build my REST documentation ? Here ? Or in another location ? And how can I generate the documentation in a server.

Thanks.

edited Aug '16

swagger UI read JSON and YAML File.

You can generate YAML file with annotations in Phalcon Micro with handler controllers.

https://docs.phalcon.io/en/latest/reference/annotations.html

https://docs.phalcon.io/en/latest/reference/micro.html#using-controllers-as-handlers

luck.

swagger generate server for:

  • lumen
  • silex
  • slim

see code.

https://editor.swagger.io/#/

Now I have much more experience in API. I recommend taking a look at RAML.



152

I was also looking for a swagger plugin, couldn't find any so I created my own..not perfect but working nicely :), if anyone wants to use feel free https://packagist.org/packages/igsem/phalcon-swagger