1

我想知道是否可以在 wso2 api manager 中自动化导入 swagger 文件的过程。如果是这样,怎么办?

谢谢

4

2 回答 2

0

您编写脚本以使用 Publisher 的 API 创建 API。

您可以将资源(包括范围)添加为 Swagger 有效负载。

https://docs.wso2.com/display/AM210/Publisher+APIs#PublisherAPIs-AddAPI

curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d "action=addAPI&name=PhoneVerification&context=/phoneverify&version=1.0.0&visibility=public&thumbUrl=&description=Verify a phone number&tags=phone,mobile,multimedia&endpointType=nonsecured&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https&resourceCount=0&resourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited&uriTemplate-0=/*&default_version_checked=default_version&bizOwner=xx&bizOwnerMail=xx@ee.com&techOwner=xx&techOwnerMail=ggg@ww.com" -d 'endpoint_config={"production_endpoints":{"url":" http://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http "}'
于 2018-05-24T10:24:26.330 回答
0

您可以编写一个 java/python 客户端或创建一个脚本,其中将包含对发布者 api 文档中提到的 API 的几个命中。

  1. 使用范围生成令牌:apim:api_create apim:api_view apim:api_publish
  2. 调用更新招摇定义
  3. 将 API-Status 更改为Publish使用更改 API 状态
于 2018-06-05T11:49:51.573 回答