WSO2中的API版本控制
在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据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/