我想知道是否有可能在wso2 api manager中自动化导入swagger文件的过程。如果是这样的话,怎么做呢?
谢谢
发布于 2018-05-24 18:24:26
您可以编写一个脚本来使用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-06-05 19:49:52
您可以编写一个java/python客户端或创建一个脚本,该脚本将包含对publisher api document中提到的API的两个命中。
使用作用域的状态:使用Change API Status将Update swagger definition
apim:api_create apim:api_view apim:api_publish
Publishhttps://stackoverflow.com/questions/50481988
复制相似问题