| swagger |
string |
Required. Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be "2.0". 必须 定义了所使用的Swagger定义的版本。可以被Swagger UI和其他客户端解释API列表。这个必须是"2.0"`. |
| info |
Info Object |
Required. Provides metadata about the API. The metadata can be used by the clients if needed.必须字段提供了API的元数据信息。元数据必要的时候可以被客户端所使用。 |
| host |
string |
The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating. 提供API服务的主机名称或者IP。这个字段必须只能是主机名,而不是包好阔scheme和子路径。该字段可以包括一个端口号。如果未指定host字段,提供当前文档本身的host将会被使用(包括端口)。host 字段不支持path templating. |
| basePath |
string |
The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). The basePath does not support path templating. 定义了提供API服务端的基础路径,这个路径是相对于host的。该字段的值必须开始于(/)。basePath 不支持path templating。 |
| schemes |
[string] |
The transfer protocol of the API. Values MUST be from the list: "http", "https", "ws", "wss". If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself. 定义了API的传输协议。取值必须为以下值之一: "http", "https", "ws", "wss"。如果没有指定schemes 字段,访问当前Swagger定义文件的默认scheme将会被使用。 |
| consumes |
[string] |
A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types.一个API可接受的MIME类型列表。这是对所有API的全局设置,但是可以被特定的API调用设置覆盖。取值必须是下面Mime Types所描述的。 |
| produces |
[string] |
A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types.一个API可能会返回的MIME类型列表。这是对所有API的全局设置,但是可以被特定的API调用设置覆盖。取值必须是下面Mime Types所描述的。 |
| paths |
Paths Object |
Required. The available paths and operations for the API. 必须字段 定义了API中可用的路径以及操作。 |
| definitions |
Definitions Object |
An object to hold data types produced and consumed by operations. 操作可能会接收或者返回的保存各种类型数据的对象。 |
| parameters |
Parameters Definitions Object |
An object to hold parameters that can be used across operations. This property does not define global parameters for all operations. 可以跨操作传递参数的一个对象。这个属性不会为所有的操作定义参数。 |
| responses |
Responses Definitions Object |
An object to hold responses that can be used across operations. This property does not define global responses for all operations. 可以被各个操作使用的持有应答信息的对象。这个属性不会为所有的操作定义全局的应答。 |
| securityDefinitions |
Security Definitions Object |
Security scheme definitions that can be used across the specification. 被整个规范所使用的安全scheme定义。 |
| security |
[Security Requirement Object] |
A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition. 一个定义了哪种安全sheme整体应用到API的声明。值中列出了备选的安全scheme(也就是说安全要求之间是个逻辑OR的关系)。单个操作可以覆盖这个定义。 |
| tags |
[Tag Object] |
A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared may be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. 被规范所使用的一组tag列表,带有附加的元数据。标签的属性努可以用来被解析工具用来反射他们的顺序。不是所有被Operation Object 所使用的标签都一定要声明。未声明的标签可以被随机的组织,或者按照工具的逻辑组织。列表中的每个标签必须是唯一的。 |
| externalDocs |
External Documentation Object |
Additional external documentation. 附加的外部文档。 |
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论