WSO2 API Manager Swagger Integration (Model schema) - wso2

I have some questions regarding WSO2 API manager swagger integration.
1) I want to add a model schema to the swagger API, for this, I have edited swagger doc and added model to it. But it is not showing the model schema in swagger console.
2) Can i upgrade swagger to a latest version ??
3) Where the swagger json files will be saved when we create an API in API manager ??

I comment your questions:
1) I have the same issue :-( Did you find the solution at last?
2) AFAIK, you can't update a single component of a WSO2 product. It's a combo. APIMgr uses swagger 1.1 version. I think is too old and must be updateable, but..
3) You can find this .json files entering by http:// apimanagerserver:9443[+offset]/carbon -> Resources -> Browse and navigate to: /_system/governance/apimgt/applicationdata/api-docs/YourAPIName-1.0-admin/api-doc.json

Related

WSO2 AM API DOCS - Is there a way to use swagger as API Documentation in DevPortal?

The company that i work for is developing an API to allow an integration with our applications. We're using WSO2 AM as our gateway. I hava to document the API and they want me to use WSO2 devportal to do so. But the problem is that they also wanna use Swagger to create this documentation. Is there a way to add Swagger in the API Docs?
One workaround would be, you can add document type of Markdown and add the swagger content as code.
So it can be viewed from Devportal as shown below:

WSO2 API Manager download API Definition

Is there a way to download API definition (JSON or YML) from Developer Portal? I mean, is there any default link I can point to get this file from API or API Product?
PS: It is easy to do it from Publisher interface but I can't find any option on DP.
Thanks!
You can download the API definition from the Devportal as well. Click on the Swagger as in the following image.

WSO2 API Manager: need to create API from backend using swagger file

I have a requirement where I need to create APIs in wso2 api manager using swagger file for an API. Also, this should be created from backend.
I have been able to create APIs from backend as per the link https://docs.wso2.com/display/AM1100/apidocs/publisher/#!/operations#APICollection#apisPost
but it does not take swagger file for an API. How can I create an API using swagger file from backend.
Please help as I am stuck here.
Thanks
This cannot be done. You will have to follow the payload definition which is defined in the Post request.
Even if you try to import a Swagger file in API Manager publisher, still you need to manually change the API name, throttling policies and etc when creating the API.

Disable community features in WSO2 API Manager

Is it possible to disable the community features from the WSO2 API Manager? This is the section in an API that allows a use to 'share' the API via email or social media sites. I have looked through the documentation and the api-manager.xml configuration file but can't seem to find out how. I have already been able to disable the comments, ratings and forum but can't seem to disable the social media parts.
Currently, there is no configuration to remove that section from UI. But you can modify the theme by subtheme approach. Here is what you have to do.
1) Put a copy of below file to a new subtheme directory as mentioned in above doc.
<APIM_HOME>/repository/deployment/server/jaggeryapps/store/site/themes/wso2/templa
tes/api/overview/template.jag
2) Remove social links section from that file.
3) Configure new subtheme in site.json.

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.