PipedreamHQ / pipedream

Connect APIs, remarkably fast. Free for developers.
https://pipedream.com
Other
8.78k stars 5.27k forks source link

[FEATURE] support automatic API generation for OpenAPI specs #13510

Open joscha opened 1 month ago

joscha commented 1 month ago

Is your feature request related to a problem? Please describe.

If you look here you can see there is a package that can generate automated code for an OpenAPI endpoint, such as:

$ npx api install https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json

resulting in a local package @api/petstore becoming available in the node execution scope:

const petstore = require('@api/petstore');

petstore.listPets().then(({ data }) => {
  console.log(`My pets name is ${data[0].name}!`);
});

This can't currently be used, as there is no access to the node_modules closure in the workflow exection scope.

Describe the solution you'd like

it would be great to have an app type where one can give a local or remote OpenAPI spec that then uses this generator to make the generated code available in the workflow step.

Do you have a workaround?

Update: not possible; see https://github.com/readmeio/api/issues/489#issuecomment-1185679464

~It would be possible to:~ ~1. run the generator locally~ ~2. generate the code~ ~3. package it into a custom node package that is available publicly~ ~4. use this package from within the workflow code~

Comparable features in other tools? Is this feature or one like it available in another platform? If so, we'd love to hear what you like about that implementation.

Additional context

related to #9512 Loosely related to #5537, #7363 and #7999 as the official way that Personio suggests to use their API is exactly via the OpenAPI generator. This is only one example, I am sure there are a few more integrations in this repository which could benefit from using the OpenAPI spec instead of hand-rolled HTTP calls.

vunguyenhung commented 2 days ago

Looks like this need some kind of changes from Pipedream internal. I will add to Pipedream internal backlog for the team to evaluate, though we won't commit on the date to deliver this.