1
votes

I am using WSO2 API Manager 1.7.0. I designed API with API Publisher and published it. The swagger definition is getting generated automatically. But all the resources which are there in API design are not there in swagger definition. Out of 10 resources, only 4 resources specification is getting displayed in swagger definition. So i tried update option, swagger definition disappeared and only displaying {"jQuery1620012463462042712203":4} and i'm getting ERROR - UserAwareAPIConsumer Error while parsing Swagger Definition for api_example in console log. So the question is Why swagger definition is not getting generated properly (which covers all the resources) and how to overcome this problem ?

1

1 Answers

0
votes

In API Manager 1.7.0 or previous versions, we are creating the Swagger definition at the API creation time only. So if some one add more API resources by editing APIs, those will not get reflected in the Swagger JSON. The reason is in those API Manager versions, we do not provide the complete support to build swagger json from the UI (ex:add parameters). So it should be manually updated according to the requirement. So if we keep updating swagger json each time API is updated, those manual changes will be lost. As a result, we create the swagger json only once.

Here for your case, reason for disappearing content should be a syntax issue. So I suggest you to create a new API with all your resources and save. The you can find the swagger definition with all those.

API Manager 1.8.0 will be released in near future, and this update time limitation is fixed there. All the swagger related content can be added through the Publisher UI and also Store Swagger UI get all the changes in each API update as well.