REST WS & Swagger

Hello,
I created a get method rest API and I would like to know if it is possible to have some url who give the document auto generated as Swagger ?

For example I know in Visual Studio we press http:///swagger/index.html and we see the auto documentation.
I would like to know if it is possible to have the same process with webMethods.

Thanks for yours answers

Hi Vital,
Best way is to create a new REST API DESCRIPTOR I guess.
Best Regards
Onur

Yes I know that thanks. But I want to see my REST API auto generated on a Url. I expect à URL from the wM suit available and in relationship with my REST WS.
Do I need CentraSite ? I have CentraSite in my licence but when I go to URL …53305/BuisenessUI I have the message Enable your CentraSite Licence.
Do I need another component in my licence or is There is à way to activate licence I dont know ? Is really nécessary to have centrasite to see a Autogenerated documentation for my REST WS ?

Hi Vital,
Take the official Swagger implementation and exchange the JSON file.
Copy the content from all the separate generated REST API Swagger sections into one swagger JSON document.

This works for me for all my REST services with 10.x

1 Like

Hi Vital,

It depends on your webMethods version.

I have discovered that 9.8 is rather limited in REST support. Especially in the parts of generating documentation from REST resource or generating REST resources from Swagger definitions.

10.x should be more advanced in this area.

Hello Vital

You can share Swagger documents on a URL from Integration Server version 10.3. If that is not possible, you will have to share a text file containing the Swagger.

Yunus.

What’s the Swagger URL? IS 10.3 reports it as:

http://server:5555/rad/pkg:name

This doesn’t work for me.

Hi Peter,
Yes, that is always the pain point. There is no directory listing function for REST service, etc.
But it depends on your IS version.
in 10.3 it is really improved and easy.

  1. you create the REST resource. ( with or without document) // use V2
    → example for GET ‘dcrbdata’
    → example package name = GF_DCRB
    → example first foldername = GF_DCRB, second folder name DCRB_Data
    P - GF_DCRB
    F - GF_DCRB
    F - DCRB_Data

  2. you create the API descriptor and select the resource you created before. // use V2
    → example ‘rad_dcrb’

here you find the URL in the general tab. like /rad/GF_DCRB.DCRB_Data:rad_dcrb
and the host port name: like in your example. → example server:5555
!! Now check the host name in your IS console.
!! And check Is it http or https? is it the correct port 5555?

→ so you get http://server:5555/rad/GF_DCRB.DCRB_Data:rad_dcrb/dcrbdata

3a. What also works for me is the is http://server:5555/restV2/dcrbdata

  1. Swagger UI: if you now want to use Swagger UI. You can download the free version and exchange the fix JSON definition with IS RAD definitions like:

    window.onload = function() {

    // Build a system
    const ui = SwaggerUIBundle({
    // url: “Swagger.json”, // for one JSON file
    urls: [
    {url: “http://server:5555/rad/GF_DCRB.DCRB_Data:rad_dcrb?swagger.json”, name: “DCRB”},
    {url: “http://server:5555/rad/xyz?swagger.json”, name: “xyz”}
    ]