SoapUI hack for OpenAPI 3
OpenAPI 3 in SoapUI

SoapUI hack for OpenAPI 3

SoapUI had been a leading testing tool and in many places it's still popular and in use. One of the main pain-points may be the lack of OpenAPI 3 support.

SoapUI docs say that only Swagger/OpenAPI 2.0 is supported [1]. I also tried to import OpenAPI 3 definitions multiple times with negative results.

Though, there is a little hack to import APIs defined by OpenAPI 3 which works at least in SoapUI 5.7.1.

We need some API definition, let's use the training BankGround API [2] to get the OpenAPI definition [3]. Apparently, the SoapUI import dialogue asks for a JSON definition (screenshot bellow).

Article content
The OpenAPI import dialogue

But if you try to import the downloaded JSON file, it fails.

Article content
Error importing JSON definition

Let's convert the JSON definition into YAML format (Note: This might be a bit confusing for geeks who know that every JSON is already a valid YAML, since YAML is JSON's superset.) e.g. with Swagger Editor [4]. See the picture bellow how to convert the JSON definition into YAML and download the YAML file.

Article content
Converting to YAML format

Now, we have an OpenAPI definition in YAML. Let's try to import it.

Article content
Importing a YAML definition

At first sight we are using an incorrect format, since SoapUI is suggesting JSON file. Suprisingly, once we click OK, the API definition is successfully imported. 👍

Article content
OpenAPI 3 definition is imported

Importing YAML where JSON is suggested does not make much sense, but please remeber this is just a workaround. It may help you to continue with SoapUI for some time if your organization switches to OpenAPI 3.

Please share your experience of importing OpenAPI 3 in the comments. Since there's no official support for OpenAPI 3 in SoapUI you may come accross different issues and it's helpful to share them.

Links

[1] Swagger/OpenAPI Support: https://www.soapui.org/docs/rest-testing/openapi-swagger-support/

[2] BankGround API: https://bankground.apimate.eu/

[3] BankGround API Definition: https://bankground.apimate.eu/openapi.json

[4] Swagger Editor: https://editor.swagger.io/


To view or add a comment, sign in

More articles by Karel Husa

  • Fix XML content-type recognition in SoapUI 5.8.0

    The latest open-source SoapUI 5.8.

    5 Comments
  • SoapUI: What if REST API changes?

    There's a new REST API, version 1.0.

    2 Comments
  • Test cases in Bruno, part 1

    Most 📍API operations are not isolated. We usually have an API use case where we call multiple operations in the proper…

    3 Comments
  • Bruno, helper dog for your APIs

    I love visual API tools. I have been playing with APIs for 20 years.

    12 Comments
  • SOAP in a REST room

    Recently, one of the API consumers asked me for an API definition. I told him the API is a SOAP service and offered to…

  • How GPT talks to APIs

    OpenAI GPTs are able to integrate with your favorite APIs via Actions. The question is, how to tell GPT enough about…

    3 Comments
  • Troubleshooting GPT Actions: Path parameters

    OpenAI Actions is a powerful tool to connect GPTs with any other applications via APIs. Sometimes the integration is…

    1 Comment
  • Postman jailed in an internal network

    Postman is a cool tool to work with APIs: publishing API definitions, testing APIs. creating virtual mock APIs or…

    2 Comments
  • SoapUI is over. What next?

    SoapUI has been a top-notch API exploratory and integration testing tool for almost 20 years. It is simple and friendly…

    3 Comments
  • A tricky difference between JSON(Path) and XML(Path)

    Developers and testers familiar with XPath may become frustrated when trying to make more complex JSONPath expressions.…

    2 Comments

Explore content categories