简体   繁体   中英

Creating a REST API in Symfony2 using FOSRestBundle - schemas and auto-documentation

I'm creating a RESTful API in Symfony2 using the FOSRestBundle, what I would like to do for each service is define each available attribute in an array so I can validate submitted data, and automatically create documentation for each service.

Here is what I'd like to be able to do for the documentation: - Display a list of all services - Display the list of all the available actions for each service (POST, PUT, etc) - Display the expected & response paramaters inside each service.

When the client hits a service the JSON should also be directly validated against the schema.

Has anyone had any experience with this, and if so could you please point me in the right direction?

您可以使用表单和验证组件来绑定和验证请求内容,并使用https://github.com/nelmio/NelmioApiDocBundle生成文档(基于表单)。

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