Function to have retool ingest a swagger or openapi json and auto generate the resources for an app

Using this one example, https://petstore.swagger.io/, of a swagger implementation along with json, it would bee a huge win to have retool import/ingest that JSON and to auto-generate resources and a fundamental starting place for an app.

This type of automation and AI approach would further adoption of retool. Truly drag and drop of your existing API to create a mobil app, deb app or dashboard.

1 Like

Hi @Eric_Sackowitz, thank you for the suggestion! We do have the ability to create a resource from OPEN API/swagger schema. When you create a resource, choose Open API resource type and give it the URL of a schema, e.g. https://petstore.swagger.io/v2/swagger.json, and Retool will be pick up the operations & parameters defined when you use the resource in any app.

We could further improve this by generating/scaffolding an app from the resource schema, but that may be down the road!

3 Likes

I appreciate the response. Can you demonstrate how this would work? I have executed what you suggested and 1. I cannot create a mobile app with that resource, 2. hen I create the default web app, and go to "code" it says "no resources"

Hi Eric,

Once you've created a resource, you can create an app (mobile or web), go to the "Code" section, and add (+) a "Resource query". The resource should show in the dropdown for "Resource". You should be able to select it and start querying it.

If you don't see the resource there, can you take a screenshot of your resource config and a screenshot of the Code section when you've added a "Resource Query"?

A post was split to a new topic: Expose swagger schema