本节列出了OpenAPI 2.0规范的属性在API管理工具生成REST服务类时的使用。此处未列出的属性将被忽略。有几个扩展属性;这些名称以x-ISC
开头。
9.1 Swagger
-
basePath
-
consumes
-
host
-
produces
-
definitions (注意,API管理工具在生成代码时不使用Schema对象的任何属性)
-
parameters (有关详细信息,请参阅“Parameter Object”)
-
paths (有关详细信息,请参阅“Path Item Object”)
-
info (有关详细信息,请参阅“Info Object”)
-
swagger (必须为“2.0”)
有关这些属性的详细信息,请参阅https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object
9.2 Info Object
-
title
-
description
-
x-ISC_RequiredResource (以逗号分隔的已定义资源及其访问模式(资源:模式)列表,这些资源是访问REST服务的任何端点所需的)
-
version
有关这些属性的详细信息,请参阅https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object
9.3 Path Item Object
-
$ref
-
get, put, and so on (OpenAPI 2.0规范支持的所有方法)
注意,对于options方法,InterSystems不会生成存根方法供您实现。相反,
%CSP.REST
会自动执行所有选项处理。 -
parameters (有关详细信息,请参阅 “Parameter Object”)
有关这些属性的详细信息,请参阅https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object
9.4 Operation Object
-
operationId
-
summary
-
description
-
consumes
-
produces
-
parameters (有关详细信息,请参阅 “Parameter Object”)
-
x-ISC_CORS (一个标志,指示应支持此端点/方法组合的CORS请求)
-
x-ISC_RequiredResource (以逗号分隔的已定义资源及其访问模式(资源:模式)列表,访问REST服务的此端点所需)
-
x-ISC_ServiceMethod (在后端调用的用于服务此操作的类方法的名称;默认值是operationId,这通常是合适的)
-
responses (注意,在响应对象中,状态可以是HTTP状态代码或“default”)
有关这些属性的详细信息,请参阅https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object
9.5 Parameter Object
- name
- in
- description
- required
- $ref
- type (不能为“formData”;允许使用其他类型)
- format
- allowEmptyValue
- maxLength
- minLength
- pattern
- maximum
- minimum
- exclusiveMaximum
- exclusiveMinimum
- multipleOf
- collectionFormat
- minItems
- maxItems
- uniqueItems
- items (有关详细信息,请参阅 “Items Object”)
有关这些属性的详细信息,请参阅https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object
9.6 Items Object
- type
- format
- allowEmptyValue
- maxLength
- minLength
- pattern
- maximum
- minimum
- exclusiveMaximum
- exclusiveMinimum
- multipleOf
- collectionFormat
- minItems
- maxItems
- uniqueItems
有关这些属性的详细信息,请参阅https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object