How to create a Swagger *.yaml or *.json definition file and project settings?

80 views
Skip to first unread message

Vigfus A

unread,
Sep 15, 2017, 11:16:35 AM9/15/17
to Swagger
Hi,

I'm using soapUI Pro and want to import a Swagger definition file as explained in

Can someone tell me how someone who has never used Swagger can go about to do this? Either a link or a step by step instruction would be awesome :)

Best Regards,
Vigfus

Ron Ratovsky

unread,
Sep 15, 2017, 11:27:03 AM9/15/17
to swagger-sw...@googlegroups.com

Are you asking how to use SoapUI Pro or how to generate an API definition for your API?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vigfus A

unread,
Sep 15, 2017, 11:43:09 AM9/15/17
to Swagger
Sorry if I was unclear. I want to know how to generate the API defintion file in Swagger :)

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Sep 15, 2017, 11:45:15 AM9/15/17
to swagger-sw...@googlegroups.com

I assume you have an existing API.

 

Which language/library do you use to expose the API?

How big is your API?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--

You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Vigfus A

unread,
Sep 15, 2017, 12:16:37 PM9/15/17
to Swagger
There are around 10 different APIs that I can reach in Swagger, but I can't see more than that the Response Content Type is "application/json; charset=UTF-8" together with Model/Model Schema. Last time I used APIs some 10 years ago we had XML and XSD, but I can see some resemblance between XSD and Model, but I can only see the response parms as information in Swagger. I've just assumed a Swagger definition sort of is like a XSD, but I can't that equivalent to the XSD file that I want to import to soapUI.
Not sure how big they are sizewise, but varies from a single parm to close to 100 parms in the response.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Sep 15, 2017, 1:22:53 PM9/15/17
to swagger-sw...@googlegroups.com

Before diving into it more, can you explain:

 

There are around 10 different APIs that I can reach in Swagger

 

What is Swagger in that sentence?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Vigfus A

unread,
Sep 15, 2017, 1:47:29 PM9/15/17
to Swagger
It might be my terminology that is off as I haven't used Swagger before, but there's an icon in the top left that looks like this  {...}  and links to swagger.wordnik.com. It might be a third party product that allows you to test your APIs and get simple responses. I was hoping I could get a file with the data shown in the pic below i.e. like the old XSD so I could import it into soapUI and soapUI would know what to expect if I call this API. In soapUI I can build Test suites, Test cases and import data so I can run a chain of tests whereas this interface only allows me to enter data.

(In case the pic below doesn't show the model just shows the respons parm)
parm 1 - string (optional)
parm 2 - string (optional)
parm 3 - string (optional)
parm 4 - string (optional)

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Auto Generated Inline Image 1

Ron Ratovsky

unread,
Sep 15, 2017, 2:34:53 PM9/15/17
to swagger-sw...@googlegroups.com

Great, we’re making progress.

 

“Swagger” is the name of a set of open source project around the OpenAPI specification.

If you want to compare it to the SOAP days, the OpenAPI is to REST what WSDL is to SOAP.

 

The screenshot you’re sharing is from swagger-ui, one of our tools. That takes an OpenAPI specification and renders it.

 

The good news is that ‘xsd’ you’re looking for is hidden there. That would also be the file you can load into SoapUI Pro.

The bad news is that the swagger-ui version you’re using is very old and it might make things a bit trickier (might not even be supported by SoapUI Pro).

 

First thing first, lets try to find that swagger.json file.

 

Open the swagger-ui you have in your browser.

Then, open your browser’s developer tools, go to the network tab, and refresh the page.

That will show you a list of calls to load the files used in the page.

One of those files, that should be relatively up in the requests, would be a ‘swagger.json’ file. You can save it from there.

 

After you have the file, open it and look for either ‘swagger’ or ‘swaggerVersion’ in it, and let me know the value of that field.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Vigfus A

unread,
Sep 18, 2017, 2:54:52 AM9/18/17
to Swagger
Good morning,

I've looked through the Network tab and had a look in the swagger.js file (see attached pic if it's the correct file).
I came across two version notifications
At the top this was commented
// swagger.js
// version 2.0.41

and then further down this code which felt a bit odd since a developer just came by and said they were using version 1.3.6
        response: function (resp) {
          var responseObj = resp.obj || JSON.parse(resp.data);
          _this.swaggerVersion = responseObj.swaggerVersion;
          if (_this.swaggerVersion === "1.2") {
            return _this.buildFromSpec(responseObj);
          } else {
            return _this.buildFrom1_1Spec(responseObj);
          }
        }

Is that the information you need or should I look elsewhere?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

swaggerFile1.PNG

Ron Ratovsky

unread,
Sep 18, 2017, 3:26:17 AM9/18/17
to swagger-sw...@googlegroups.com

No, unfortunately that’s not it.

 

It is most likely a file called ‘swagger.json’ or simply ‘apidocs’.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Vigfus A

unread,
Sep 18, 2017, 4:22:09 AM9/18/17
to Swagger
There's no swagger.json, but in apidoc (see attached file) I found the following rows. Would that be the one?

  1. {apiVersion: "1", swaggerVersion: "1.2",…}
    1. apiVersion:"1"
    2. swaggerVersion:"1.2"

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

swaggerFile2.PNG

Ron Ratovsky

unread,
Sep 18, 2017, 4:33:59 AM9/18/17
to swagger-sw...@googlegroups.com

Yup, that’s the file. Unfortunately, it’s an old version of the spec, however I think SoapUI Pro would support it.

Save that file locally and try importing it.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Vigfus A

unread,
Sep 18, 2017, 5:10:02 AM9/18/17
to Swagger
I saved the file and tried to import it to ReadyAPI. Unfortunately I got an error (see attached file). Is there anything else I can do or should I check with the guys over at ReadyAPI?

Is it possible to upgrade to a newer version of the spec and still keep it compatible?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

swaggerFile3.PNG

Ron Ratovsky

unread,
Sep 18, 2017, 5:28:03 AM9/18/17
to swagger-sw...@googlegroups.com

It looks like there might be something corrupt with the apidocs file itself. Are you able to share it?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Vigfus A

unread,
Sep 18, 2017, 10:43:50 AM9/18/17
to Swagger
Thank you for all the help Ron! It's now been converted into ReadyAPI.

For other people trying to do this with an old Swagger version.
Bring up the Swagger side in Chrome
Bring up the Development menu, go to Network tab and refresh it
Right click on your services and choose Copy->Copy link address
Paste the link into another Chrome tab + Enter
Copy all the content displayed in the browser window
Paste it into an editor like Notepad ++ and save it as a *.json
Open ReadyAPI, create a new project and import the the swagger definition (your newly saved *.json)
Rejoice :)

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Sep 18, 2017, 11:49:07 AM9/18/17
to swagger-sw...@googlegroups.com

Happy to hear you got it sorted out!

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages