Frequently Asked Questions (FAQs)
How are generated SDKs tested?
We generate the following:
-
A set of unit tests for the core client
-
For each endpoint configured in your Stainless config file, we generate a set of test cases — sending a synchronous request with only required params, sending a synchronous with all params, and the same for asynchronous requests. We are using Prism to emulate your API based on your OpenAPI spec file.
Tests and linters are executed automatically in CI for any change to the SDK. You can also run them locally by
running ./scripts/test
in a terminal from the root of of the SDK repository, the script will setup
everything it needs and execute all tests.
In addition, we recommend that users add examples to the directory ./examples
of the generated SDK. This
directory is safe to use as you wish, Stainless won’t overwrite its content. That simplifies testing uses
cases against your live API.
Here is a concrete example: https://github.com/openai/openai-node/blob/master/examples/demo.ts
What if my API define endpoints that aren't stable yet?
Here are our recommended approaches: