WSO2中的API版本控制

发布于 2025-01-26 03:55:28 字数 946 浏览 1 评论 0原文

在WSO2 API Manager v3.2.0中,我发布了具有多个途径的API的V1。 (下面的示例缩短,API实际上具有30条不同的路径)。

我如何仅针对这些路径之一(或WSO2 Lingo中的资源)发布V2版本。

IE I 只有想要添加新的V2/status API(/xyz/v2/status), 但是我不希望其他资源的V2版本。

例如:

swagger: '2.0'
info:
  description: My Api
  version: v1
  title: MyApi
security:
  - default: []
paths:
  /health:
    get:
      parameters: []
      responses:
        '200':
          description: health check
  '/status/{id}':
    get:
      parameters:
        - name: id
          in: path
          required: true
          type: string
  '/update/{id}':
    post:
      parameters:
        - name: id
          in: path
          required: true
          type: string
        - in: body
          name: Payload
          description: Request Body
          required: false
          schema:
            type: object
            properties:
              payload:
                type: string

In WSO2 API Manager v3.2.0 I published v1 of my api that has multiple paths.
(example below is shortened, the API actually has 30 different paths).

How do I publish a v2 version for just one of these paths (or resources in wso2 lingo).

I.e. I ONLY want to add a new v2 /status api (/xyz/v2/status),
but I don't want v2 versions of the other resources.

e.g.:

swagger: '2.0'
info:
  description: My Api
  version: v1
  title: MyApi
security:
  - default: []
paths:
  /health:
    get:
      parameters: []
      responses:
        '200':
          description: health check
  '/status/{id}':
    get:
      parameters:
        - name: id
          in: path
          required: true
          type: string
  '/update/{id}':
    post:
      parameters:
        - name: id
          in: path
          required: true
          type: string
        - in: body
          name: Payload
          description: Request Body
          required: false
          schema:
            type: object
            properties:
              payload:
                type: string

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陈独秀 2025-02-02 03:55:28

根据WSO2 APIM 3.2.0实现版本适用于整个API,其中包括该API中的所有资源,而不是单个资源。因此,无法实现要求。有关更多详细信息,请参阅[1]。

[1] https:// apim。 docs.wso2.com/en/3.2.0/reference/samples/api-versioning-sample/

According to the WSO2 APIM 3.2.0 implementation versioning is applicable for an entire API which includes all the resources in that API and not for an individual resource. Therefore, the requirement cannot be achieved out-of-the-box. For further details refer [1].

[1] https://apim.docs.wso2.com/en/3.2.0/reference/samples/api-versioning-sample/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文