Our specification file is using Swagger v2

Last updated: November 15, 2024

If your API specification file is using Swagger v2, you will need to convert it to OpenAPI v3 to be able to use it with Stainless.

The conversion can often be automated using tools such as swagger2openapi. Assuming you already have node and npm installed locally, you can run it without having to install anything, with the following command:

npx -p swagger2openapi swagger2openapi --yaml --outfile my-company-openapi.yml \
    --warnOnly \
    --patch=true \
    my-swagger2-spec-file.json

The resulting file my-company-openapi.yml can then be used for your Stainless project.