sae*_*edj 13 swagger swagger-2.0 openapi
我有以下架构定义:
swagger: '2.0'
...
definitions:
Service:
type: object
properties:
serviceId:
type: string
description: Device or service identification number
example: 1111111111
location:
type: string
description: Location of the service
example: '400 Street name, City State postcode, Country'
Run Code Online (Sandbox Code Playgroud)
我想对location已弃用的字段进行注释。有没有办法做到这一点?
Hel*_*len 17
deprecated在OpenAPI 3.0中添加了标记架构和架构属性的可能性:
openapi: 3.0.1
...
components:
schemas:
Service:
type: object
properties:
location:
type: string
description: Location of the service
example: '400 Street name, City State postcode, Country'
deprecated: true # <---------
Run Code Online (Sandbox Code Playgroud)
如果您使用OpenAPI 2.0(Swagger 2.0),则唯一可以做的就是在属性中以口头形式记录弃用情况description。
Tom*_*mas 13
根据文档,使用deprecated属性就足够了
/pet/findByTags:
get:
deprecated: true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8714 次 |
| 最近记录: |