Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE during API export if the swagger.json file is missing from the registry #2288

Closed
imedyaosandi opened this issue Nov 28, 2023 · 1 comment

Comments

@imedyaosandi
Copy link

Description

The below error can be observed during API export if the swagger.json file missing from the registry.

java.lang.NullPointerException

at java.io.StringReader.<init>(StringReader.java:50)

at com.google.gson.JsonParser.parseString(JsonParser.java:50)

at com.google.gson.JsonParser.parse(JsonParser.java:112)

at org.wso2.carbon.apimgt.importexport.utils.APIExportUtil.exportMetaInformation(APIExportUtil.java:874)

at org.wso2.carbon.apimgt.importexport.utils.APIExportUtil.retrieveApiToExport(APIExportUtil.java:258)

at org.wso2.carbon.apimgt.importexport.APIService.exportAPI(APIService.java:165)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)

at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)

at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201)

at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104)

Steps to Reproduce

Execute the following command to export the API from the publisher portal for an API that does not have the swagger.json:

curl --location '[https://xxxx:port/api-import-export-2.6.0-v18/export-api?name=test&version=1.0&provider=LDAP/mmaa&preserveStatus=true'](https://hom-publisher.apim.ca-assurances.intra/api-import-export-2.6.0-v18/export-api?name=test&version=1.0&provider=LDAP/mmaa&preserveStatus=true%27) \

--header 'Authorization: Basic [base64encode(username:password)]'

Affected Component

APIM

Version

2.6.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants