将 swagger 定义导入 SoapUI 社区版? [英] Import swagger definition to SoapUI community edition?

查看:35
本文介绍了将 swagger 定义导入 SoapUI 社区版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 SoapUI(免费/开源版本),看看它是否对我们经常进行的那种广泛的 API 测试有用,因为现在我们大部分测试都是在 swagger 上进行的每个服务器/应用程序中的 -ui 页面以及一些功能(例如自动化某些测试用例)可能非常方便(以及许多其他功能).

我遇到的问题是,我无法弄清楚如何将所有端点导入到 SoapUI 中,而不必手动一一创建它们.我看到有一个从 swagger 导入的选项,但我似乎无法让它工作,谷歌搜索到目前为止对我没有帮助.

  1. 使用免费版本可以做到这一点吗?我知道休息发现是一个专业功能,但它不是我正在寻找的.
  2. 谁能告诉我步骤是什么?我尝试将其指向 swagger-ui 页面,但这没有任何作用.我可以访问应用程序源代码(用 java+spring 编写),我需要导入的 swagger 定义是否位于那里?四处张望,但我可能没有找对地方.

我知道我陷入了一些可能非常简单的事情,但我很感激这方面的任何帮助.

这是使用 SoapUI 版本 5.2.1

解决方案

您可以按照以下步骤将 swagger 定义导入 SoapUI,并确保 swagger 定义 在手或其 url(基本上是一个 json ).

前提是,为 SoapUI 安装了 swagger 插件,如图

  • 它将显示一个对话框,您可以在其中提供 swagger 定义网址.
  • 你已经完成了.所有资源及其方法都应出现在您的项目中.

    如果您无法在右键单击上下文中看到 Import Swagger 选项,则说明未安装插件.如果您安装了 SoapUI-5.2.1

    ,请确保它已安装

    更新

    添加一些公开的 swagger 定义,这样对于想要尝试的人来说会很方便.

    这是

    I'm playing around with SoapUI (the free/open source edition) to see if it could be useful at work for the kind of extensive API testing we often do because right now we do most of our testing right on the swagger-ui page in each server/app and some of the features like automating some test cases could be really handy (among many others).

    The problem I have is that I can't figure out how to import all the endpoints into SoapUI without having to manually create them one by one. I see there's an option to import from swagger but I can't seem to get it to work and googling around hasn't helped me so far.

    1. Is it possible to do that using the free version? I know REST discovery is a pro feature but it isn't what I'm looking for.
    2. Could anyone tell me what the steps would be? I tried pointing it to the swagger-ui page but that didn't do anything. I have access to the application source code (written in java+spring) would the swagger definition I need to import be located somewhere there? Poked around but I'm probably not looking in the right place.

    I know I'm stuck in something that's probably ridiculously easy but I would appreciate any help with this.

    Edit: This is using SoapUI Version 5.2.1

    解决方案

    Here are the steps you can follow in order to import the swagger definition into SoapUI, and make sure swagger definition is in hand or its url(basically a json ).

    Pre-condition is that, swagger plugin is installed for SoapUI as shown here

    1. Create an empty project using File -> Create Empty Project menu options.
    2. Right click on the project created in above step.
    3. You should be able to see an option like Import Swagger as shown below.
    4. It will show a dialog where you can provide the swagger definition url.

    You are done. All the resources and its methods should appear in your project.

    If you are not able to see the Import Swagger option in the right click context, then plugin is not installed. Am sure it is installed if you have installed SoapUI-5.2.1

    Update

    Adding some public swagger definition, so that it would be handy for someone wish to try one.

    Here is the pet store swagger definition v2.0 by SwaggerUI

    You would see something like below once swagger definition is imported.

    这篇关于将 swagger 定义导入 SoapUI 社区版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆