Forum Discussion

darekdg6pl's avatar
darekdg6pl
New Member
2 years ago

Problem with importing openapi

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

SoapUI 5.7.0, Windows, schema 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!

  • mcarmain's avatar
    mcarmain
    Occasional Visitor

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

  • mju's avatar
    mju
    Regular Visitor

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

    if (yaml or yml) import with swagger2

    else //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)

    {"openapi":"3.0.1"

    with 

    {"swagger":"2.0"

     and then to import the file.