全文预览

RESTful API设计原则与规范

上传者:叶子黄了 |  格式:docx  |  页数:15 |  大小:501KB

文档介绍
客户端和服务器端骨架代码可以加速开发和测试速度通常情况下,API的Swagger描述为JSON文件,也可使用YAML描述的文件。附Swagger文件示例:{"swagger":"2.0","info":{"version":"1.0.0","title":"SwaggerPetstore(Simple)","description":"AsampleAPIthatusesapetstoreasanexampletodemonstratefeaturesintheswagger-2.0specification","termsOfService":"/terms/","contact":{"name":"SwaggerAPIteam","email":"foo@","url":"http://swagger.io"},"license":{"name":"MIT","url":"/licenses/MIT"}},"host":"petstore.swagger.io","basePath":"/api","schemes":["http"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/pets":{"get":{"description":"essto","operationId":"findPets","produces":["application/json","application/xml","text/xml","text/html"],"parameters":[{"name":"tags","in":"query","description":"tagstofilterby","required":false,"type":"array","items":{

收藏

分享

举报
下载此文档