Use a local OpenAPI spec
Generate your API and SDK documentation based on a local OpenAPI spec and Stainless config to see unpublished changes or experiment in an isolated environment.
First, create a new test-specs directory in the root of the local copy of your docs project. The test-specs directory is ignored in our default .gitignore, and should not be committed.
Next, put the OpenAPI spec and Stainless config you want to use in the test-specs directory. If you want to start with your current versions, copy them from the Stainless dashboard.
π <root>ββ π public/ββ π src/β ββ π assets/β ββ π content/β ββ π docs/ββ π test-specs/β ββ π openapi.jsonβ ββ π openapi.stainless.ymlββ π .envββ π astro.config.tsββ π package.jsonUpdate your .env file to include the paths to your local specs. If you used the Stainless CLI to authenticate and donβt have an .env file, create one with the content shown below.
STAINLESS_CONFIG_PATH=./test-specs/openapi.stainless.ymlOPENAPI_PATH=./test-specs/openapi.jsonYour local development server will now use the files specified in your environment variables.