PipedreamHQ / PipedreamHQ/pipedream

[FEATURE] support automatic API generation for OpenAPI specs

Open
#13,510 1 comment 0 reactions 0 assignees View on GitHub
enhancement tracked internally triaged
Dominant language
JavaScript
Stars
11.7k
Forks
5.8k
Avg merge
3d 10h
Merged PRs (30d)
102

Description

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

If you look [here](https://www.npmjs.com/package/api) you can see there is a package that can generate automated code for an OpenAPI endpoint, such as:

```sh
$ 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:
```js
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.