| title | FAQ |
|---|---|
| category | 5d4c940cae4e610060475769 |
Yes! YAML definitions will be automatically converted to JSON when they're fetched for either SDK code generation or dynamic api usage.
At the moment it does not. If you wish to use an API that has a Swagger 2.0 file, you'll need to first convert it to an OpenAPI 3 definition.
Yes!
No! Since v4 is still in the early planning stages we don't support it but once it's finalized we will.
Not yet, unfortunately. For APIs that use OAuth 2, you'll need a fully-qualified token already for api to make requests.
Not yet! This is something we're thinking about how to handle, but it's difficult with the simplified nature of the .auth() method as it by design does not ask the user to inform the SDK of what kind of authentication scheme the token they're supplying it should match up against.
If you have ideas on how to handle this we'd love to hear them.
If you generate an SDK with the CLI installation process then yes! If you're having trouble getting autogenerated SDKs working in a browser, please let us know!
Unfortunately the dynamic version of api will not work in browsers as it requires access to the filesystem for handling and managing its cache state.
Not yet! This is something we're thinking about in the future.
Not yet! The URL that you give the module must be publicly accessible. If it isn't, you can download it to your computer or server and then use the absolute path to that file instead.
$ npx api install ./path/to/downloaded.jsonconst sdk = require('api')('./path/to/downloaded.json');See How does it work? for some information on how, when, and where api caches its data.