# Problem with importing openapi

**URL:** <https://community.smartbear.com/t/problem-with-importing-openapi/193>\
**Category:** SoapUI OS\
**Tags:** api, soapui, migrated, soap\
**Created:** [December 9, 2022, 8:56am UTC](https://community.smartbear.com/t/problem-with-importing-openapi/193 "2022-12-09T08:56:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [December 9, 2022, 8:56am UTC](https://community.smartbear.com/t/problem-with-importing-openapi/193/1 "2022-12-09T08:56:38Z")

</div>

> Originally posted by **darekdg6pl** on December 09, 2022

Team, I’m facing problems with importing OpenAPI specification.

SoapUI 5.7.0, Windows, schema [https://instana.github.io/openapi/openapi.json,](https://instana.github.io/openapi/openapi.json,) error I got:

- Fri Dec 09 09:43:15 CET 2022:ERROR:java.lang.NullPointerException: Cannot invoke “com.smartbear.swagger.SwaggerImporter.importSwagger(String)” because “this.val$importer” is null
- java.lang.NullPointerException: Cannot invoke “com.smartbear.swagger.SwaggerImporter.importSwagger(String)” because “this.val$importer” is null
- at com.smartbear.swagger.SwaggerUtils$1.construct(SwaggerUtils.java:143)
- at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
- at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:131)
- at java.base/java.lang.Thread.run(Thread.java:831)

Any suggestions what might be wrong? The specification seems to be just fine. Thanks for any advice!

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [June 9, 2023, 11:06pm UTC](https://community.smartbear.com/t/problem-with-importing-openapi/193/2 "2023-06-09T23:06:15Z")

</div>

> Originally posted by **mcarmain** on June 09, 2023

I have same issue importing swagger.json that is version 3

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 17, 2023, 9:54pm UTC](https://community.smartbear.com/t/problem-with-importing-openapi/193/3 "2023-11-17T21:54:41Z")

</div>

> Originally posted by **mju** on November 17, 2023

The code tests for the swagger version and the logic is basically:

if (yaml or yml) import with swagger2

else [//i.e](https://i.e). .json

if (version = swagger 2.0) import with swagger2

else return null ==\> exception

The workaround for openapi files in .json format seems to be to replace this (e.g. for version 3.0.1)

```auto
{"openapi":"3.0.1"

```

with

```auto
{"swagger":"2.0"

```

and then to import the file.
