Example of API Doc generation

Source: Internet
Author: User

Example of API Doc generation

Api generation interface document example:

{"Name": "interface for getting free risks in January", "version": "1.0.0", "description ": "September free to receive sharing activity interface documentation (t = 1)", "sampleUrl": "http://www.phpernote.com /"}

Saved file name: apidoc. json

Apidoc-I project directory for document generation-o interface file generation directory

The code of the interface code file is as follows:

<? Php/*** @ api {post}/news/lists news information list * @ apiVersion 1.0.0 * @ apiName lists * @ apiGroup User * @ apiPermission Login User ** @ apide.pdf User Login and then enter the page, the news information list is displayed ** @ apiSampleRequest/v1/news/lists ** @ apiSuccess (Return Value) {string} id Primary Key ID * @ apiSuccess (return value) {string} name customer name * @ apiSuccess (Return Value) {string} user_head_img customer profile * @ apiSuccess (Return Value) {integer} sex Gender: 0-not set, 1-male, 2-female * @ apiSuccess (Return Value) {string} d Emand customer requirements ** @ apiSuccessExample {json} success example: * {"code": 1, "msg": "", "data": {"id ": "57b3cdb46b787", "name": "Cao", "user_head_img": "userHead/2016-08-18/1034587522576. jpg "," sex ":" 1 "," demand ":" I want to buy insurance. Please contact us quickly! "} ** @ ApiErrorExample (json) Error example: * {" code ":-1," msg ":" Incorrect password "," data ": {}}*//////////////////////////////////// //// *** @ api {post}/news/rob grabs customers * @ apiVersion 1.0.0 * @ apiName rob * @ apiGroup User * @ apiPermission Login User ** @ apide.pdf customer master ** @ apiParam {string} id Primary Key ID ** @ apiSampleRequest/v1/news/rob ** @ apiSuccessExample {json} success example: * {"code": 1, "msg": "", "data" :{}}** @ apiErrorExample (json) Error example: * {"code ": -1, "msg": "error message", "data ": {}}*//////////////////////////////////// ////

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.