Add ability to import a swagger json from file
3542
Views
21
Comments
Implemented
Data & Integrations
Development Environment Release 34

I'm not sure if there is already an existing idea like this, the search didn't provide me with a match so I'm creating one...

We have the ability to import a swagger 2.0 rest services already, but unlike its SOAP counterpart we lack the ability to do this locally from a file


This should be added IMHO

Best regards,

PC

Changed the category to
Integration

Hi Pedro,

I like this idea! You are reading my mind. I'm currently consuming REST services from a MuleSoft API. I'm not sure if they can expose them in Swagger 2.0 or not, but I'm currently doing the interfaces manually. It would also be nice to be able to export Swagger 2.0 as well.


You're getting a 'like' from me! 

Thanks!


Daryl 

Can you use a file:// URL? That has always worked with WSDL imports before they added the "Choose File" button, I bet that trick works with Swaggers too. I know it's not as helpful as the "Choose File" button but it should be a usable workaround in the meantime.


J.Ja

Best regards,

PC

Booooo! That's lame.

J.Ja

UserImage.jpg
Stuart Parker

Having an out of box solution would be nice. In the mean time check out the Swagger Proxy forge component.

https://www.outsystems.com/forge/component-overview/1270/swaggerproxy

A workaround that I found is that you can use https://file.io/ for this. This allows you to upload the swagger. Use the generated link to import it in Outsystems. And the file will automatically be deleted after this. Then you only need to change the base url from file.io to your required url.

That is good to know, but it's a workaround that we shouldn't have to do since we have it for SOAP

Best regards,

PC

Changed the status to
Implemented
on 11 Sep 2019

Hi Pedro,

Thanks for your feedback.

I'm glad to announce that this capability was implemented on Service Studio. Please take a look and provide your feedback.


Awesome Fernando Moitinho!

Best regards,

PC

Merged this idea with 'Generate REST API Methods from Swagger Definition' (created on 06 Aug 2018 20:00:33 by Craig St.Jean)

I love that OutSystems can consume a Swagger definition to generate REST consumers, and that OutSystems can generate Swagger for exposed REST services.  That said, we have some services where the API is designed ahead of time in Swagger, would it be possible to generate REST methods, inputs, and outputs from a pre-written Swagger file?



This comment was:
- originally posted on idea 'Generate REST API Methods from Swagger Definition' (created on 06 Aug 2018 by Craig St.Jean)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:15:58 by Kilian Hekhuis
Changed the category to
Integration

Move to Integration



This comment was:
- originally posted on idea 'Generate REST API Methods from Swagger Definition' (created on 06 Aug 2018 by Craig St.Jean)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:15:58 by Kilian Hekhuis

Sounds like: https://www.outsystems.com/ideas/6434/add-ability-to-import-a-swagger-json-from-file



This comment was:
- originally posted on idea 'Generate REST API Methods from Swagger Definition' (created on 06 Aug 2018 by Craig St.Jean)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:15:58 by Kilian Hekhuis
Merged this idea with 'Expose REST API from imported Swagger.json' (created on 10 Mar 2020 19:53:47 by Daniel Garcia)

For the particular use case I have in mind, I want to be able to expose a REST API in a module based off a Swagger specification. I want to read a business class in C#, take its attributes, and automatically generate a Swagger specification for any data entry operations (Get Object, Update Object, Delete Object, etc.). This part I can do outside of OutSystems. The issue is importing this specification into the Service Studio. I can easily consume a REST API from a Swagger specification, but I have to manually generate the REST API methods and parameters when exposing one.


Is there some way I can do this that I am not aware of? If not, is there some way that I can modify the Service Studio to accomplish this?


Here's some screenshots of the manual process that I'm trying to automate:

1. Expose a REST API

2. Name it after a business class/object

3. Create methods to Get, Create, Update, and Delete the business class/object



This comment was:
- originally posted on idea 'Expose REST API from imported Swagger.json' (created on 10 Mar 2020 by Daniel Garcia)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:18:29 by Kilian Hekhuis
Merged this idea with 'Create OutSystems REST API based on swagger files' (created on 13 May 2020 10:02:06 by Christophe Flaviani)

Goal of this idea is double:

  1. Sometimes you cannot query the end-point to get the API definitions that the end-point is presenting you. In that case, the goal would be that you provide the API definition (swagger or OAS3 or other) and that the REST API call is created based on the API definition
  2. When we have to create API end-points in OutSystems (not calling an external API, but presenting an API end-point) it would be helpfull to use the swagger definition to create the end-point
  3. The other way around: if we design a REST API in OutSystems, we should be able to export the swagger definition from it.




This comment was:
- originally posted on idea 'Create OutSystems REST API based on swagger files' (created on 13 May 2020 by Christophe Flaviani)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:19:05 by Kilian Hekhuis

Hi Christophe,

For your first point, the platform already allows you to consume a REST API by uploading a swagger file if you go "Consume REST API" -> "Add All Methods" -> "Choose File"  you can upload a swagger file and all methods and structures will be created. Take a look here: https://www.outsystems.com/whats-new/import-swagger-file/.




This comment was:
- originally posted on idea 'Create OutSystems REST API based on swagger files' (created on 13 May 2020 by Christophe Flaviani)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:19:05 by Kilian Hekhuis

Thanks for pointing out, Rodolfo. I didn't know that ... :D



This comment was:
- originally posted on idea 'Create OutSystems REST API based on swagger files' (created on 13 May 2020 by Christophe Flaviani)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:19:05 by Kilian Hekhuis

Would be nice of we could also do this when  we want to expose an API



This comment was:
- originally posted on idea 'Create OutSystems REST API based on swagger files' (created on 13 May 2020 by Christophe Flaviani)
- merged to idea 'Add ability to import a swagger json from file' on 03 Aug 2020 13:19:06 by Kilian Hekhuis