简体   繁体   中英

How to add a Swagger definition for WSO2 API Manager from SwaggerHub?

In my case, I'm using WSO2 API Manager version 1.7. This version allows loading an externally published Swagger definition and importing it via a URL.

I designed a Swagger definition on SwaggerHub and published on there. But I couldn't load that definition into API Manager.

Also, I just copied the Swagger JSON and pasted when editing the API definition after adding an API. Even though it shows properly saved, I cannot see the exact JSON content. It has been saved as some text.

How can I resolve these issues and add a properly working Swagger definition to WSO2 API Manager 1.7?

NOTE: It works with 1.10.

What is the swagger version you are using? If it is working in AM 1.10 the document probably is written in version 2.0. AM 1.7 use older version of swagger (v1.1). This probably could be the reason for not working in AM 1.7. If you cannot upgrade to AM 1.10, then you could try creating the swagger doc using the v1.1 notations

You should be able to read your API from SwaggerHub directly using this URL structure:

https://api.swaggerhub.com/apis/{username}/{api-name}/{version}

The accept header can be application/json or application/yaml . If wso2 1.7 is having trouble importing it, there are likely some unsupported features in the wso2 tooling itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM