• 第十二章 使用中的 OpenAPI 属性


    第十二章 使用中的 OpenAPI 属性

    本附录列出了 API 管理工具在生成 REST 服务类时使用的 OpenAPI 2.0 规范的属性。此处未列出的属性将被忽略。有几个扩展属性;它们的名称以 x-ISC 开头。

    Swagger

    • basePath

    • consumes

    • host

    • produces

    • definitions (请注意,API 管理工具在生成代码时不使用 Schema 对象的任何属性)

    • parameters (for details, see “Parameter Object”)

    • paths (for details, see “Path Item Object”)

    • info (for details, see “Info Object”)

    • swagger (must be “2.0”)

    有关这些属性的详细信息,请参阅 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object。

    Info Object

    • title

    • description

    • x-ISC_RequiredResource (访问 REST 服务的任何端点所需的已定义资源及其访问模式 (resource:mode) 的逗号分隔列表)

    • version

    有关标准属性的详细信息,请参阅 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#info-object。

    Path Item Object

    • $ref

    • get, put, and so on (支持 OpenAPI 2.0 规范中列出的所有方法)

    请注意,对于 options 方法, 不会生成存根方法供实现。相反,%CSP.REST 类会自动执行所有选项处理。

    • parameters (for details, see “Parameter Object”)

    有关标准属性的详细信息,请参阅 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#pathItemObject.

    Operation Object

    • operationId

    • summary

    • description

    • consumes

    • produces

    • parameters (for details, see “Parameter Object”)

    • x-ISC_CORS (一个标志,指示应支持对此端点/方法组合的 CORS 请求)

    • x-ISC_RequiredResource (访问 REST 服务的此端点所需的已定义资源及其访问模式 (resource:mode) 的逗号分隔列表)

    • x-ISC_ServiceMethod (在后端调用以服务此操作的类方法的名称;默认是 operationId,通常是合适的)

    • responses (请注意,在响应对象中,状态可能是 HTTP 状态代码或“默认”)

    有关标准属性的详细信息,请参阅 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operationObject。

    Parameter Object

    • name

    • in

    • description

    • required

    • $ref

    • type (cannot be “formData”; other types are permitted)

    • format

    • allowEmptyValue

    • maxLength

    • minLength

    • pattern

    • maximum

    • minimum

    • exclusiveMaximum

    • exclusiveMinimum

    • multipleOf

    • collectionFormat

    • minItems

    • maxItems

    • uniqueItems

    • items (for details, see “Items Object”)

    有关这些属性的详细信息,请参阅 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameter-object。

    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#items-object。

  • 相关阅读:
    代码随想录训练营二刷第二十四天 | 77. 组合
    JavaScript相关面试题:setTimeout的运行机制
    初识C语言 -- 结构体,分支和循环语句
    【每日一题】43. 字符串相乘
    BL200OPC UA分布式IO系统接线方式
    微信支付证V3
    redis增删改查
    (面试题)面试官为啥总是让我们手撕call、apply、bind?
    AUTOSAR知识点 之 ECUM (三):ECUM的ISOLAR-AB配置及代码解析
    2024北京智慧养老展,北京养老应用软件展,北京陪护机器人展
  • 原文地址:https://blog.csdn.net/yaoxin521123/article/details/126081409