swagger -- ref 自定义的使用
来源:互联网 发布:java 运行环境变量 编辑:程序博客网 时间:2024/04/29 13:45
400err定义了一个可重用的响应,它指定了我们在所有端点下使用的400响应,然后进行适当的引用。
swagger: '2.0'info: version: 1.0.0 title: Simple Artist API description: A simple API to understand the Swagger specification in greater detailschemes: - httpshost: example.iobasePath: /v1securityDefinitions: UserSecurity: type: basicsecurity: - UserSecurity: [] paths: /artists: get: description: Returns a list of artists parameters: - $ref: '#/parameters/PageLimit' - $ref: '#/parameters/PageNumber' responses: 200: description: Successfully returned a list of artists schema: type: array items: $ref: '#/definitions/Artist' 400: # ----- Added line ---------------------------------------- $ref: '#/responses/400Error' # ---- /Added line ---------------------------------------- post: description: Lets a user post a new artist parameters: - name: artist in: body description: creates a new artist in our database schema: $ref: '#/definitions/Artist' responses: 200: description: Successfully created a new artist 400: # ----- Added line ---------------------------------------- $ref: '#/responses/400Error' # ---- /Added line ---------------------------------------- /artists/{username}: get: description: Obtain information about an artist from his or her unique username parameters: - name: username in: path type: string required: true responses: 200: description: Successfully returned an artist schema: type: object properties: artist_name: type: string artist_genre: type: string albums_recorded: type: integer 400: # ----- Added line ---------------------------------------- $ref: '#/responses/400Error' # ---- /Added line ---------------------------------------- definitions: Artist: type: object required: - username properties: artist_name: type: string artist_genre: type: string albums_recorded: type: integer username: type: string# ----- Added lines ----------------------------------------parameters: PageLimit: name: limit in: query type: integer description: Limits the number of items on a page PageNumber: name: offset in: query type: integer description: Specifies the page number of the artists to be displayedresponses: 400Error: description: Invalid request schema: type: object properties: message: type: string# ---- /Added lines ----------------------------------------
阅读全文
0 0
- swagger -- ref 自定义的使用
- swagger 的使用
- Swagger UI的使用
- swagger的使用
- swagger注解的使用
- Swagger-Codegen的简单使用
- REF的使用
- ref 的使用。
- SpringMVC集成Swagger插件以及Swagger注解的简单使用
- swagger使用
- Swagger使用
- swagger使用
- 使用swagger生成API的json文件
- django-rest-swagger的优化使用
- 使用swagger创建功能强大的API
- laravel(5.2) Swagger UI的使用
- ref和out的使用
- c# ref out 的使用
- python3中单引号,双引号,三个单引号 ,三个双引号的差别,以及反斜杠的用法
- 透视
- 【Spark】sortBy[T]和sortByKey[T]排序详解
- pcl点云索引与应用
- 安装Ubuntu遇到的一些坑
- swagger -- ref 自定义的使用
- 思维导图之如何战胜拖延症
- linux FTP启动
- javascript函数式编程库-underscore.js
- 【12月19日】LeetCode刷题日志(三):Best Time to Buy and Sell Stock with Transaction Fee
- JavaScript数据可视化编程学习(一)Flotr2,包含简单的,柱状图,折线图,饼图,散点图
- 最简单的排序--桶排序java实现
- 2012年第三届蓝桥杯(C/C++)预赛题目及个人答案(欢迎指正)
- android生命周期钩子