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).
But if you try to import the downloaded JSON file, it fails.
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.
Now, we have an OpenAPI definition in YAML. Let's try to import it.
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. 👍
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/
📍API & Integration Architect
1yFilip Aron
Thanks for sharing the knowledge @karel
Nice hack Karl. Thank you.