简体   繁体   中英

Best Practice for documenting Symfony2 based REST API

I like to document my API (REST with JSON) which is written in PHP with the Symfony2 Project. This means I would like to write a public API, which I can give out to my clients, without showing them my internal functions etc.

What is the best practice to write Documentation in the public functions (Controllers, etc...). I'm currently using YAML for routing, which seems to be incompatible with the Annotation Based PHPDoc.

Thank you in advance!

You should then use NelmioApiDocBundle which was designed specifically for the need of documenting Restful Symfony2 API(s).

Find the bundle's documentation here .

It provides an ApiDoc() Annotation for Controllers,

And it also allows you to browse the whole documentation through an interfactive web interface,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM