Generate API smoke tests from an OpenAPI document
The OpenAPI importer turns a specification into smoke tests with no AI involved: one Vera test per tag, one api-request step per operation, each checking the status the document declares. Paths stay relative, so the same tests run against whichever base URL or environment the project points at.
What comes across
- One Vera test per tag (or per path when an operation is untagged), with each operation as an api-request step.
- Each step expects the lowest 2xx status the operation declares; with none declared, any 2xx passes.
- Path parameters are filled from their example, then from the first enum value, and otherwise left as a {{param}} variable added to the project.
- Request bodies come from the example or examples when the document has them (JSON only, up to 10 KiB).
- Steps use relative paths so the project base URL applies; the document’s servers entry is shown as a warning, never hard-coded.
What does not
- YAML documents are not supported; convert the document to JSON first.
- Each step checks the response status only. Response bodies are not validated against the schema.
- Security schemes import no credentials; configure auth (a role or headers) in Vera.
- head, options and trace operations are counted and named in a warning, but not imported.
How to set it up
- Open a project's Tests page and choose Import tests, then pick your OpenAPI document (.json). The format is detected from each file.
- Set the project base URL to your API host — the imported paths are relative.
- If the API declares security schemes, configure auth in Vera before running.
- Or convert from the repository: npx vera-agent init --import openapi finds the specs and uploads them through the CI API, which needs Pro or above on Vera's cloud (self-hosted installs include it). The dashboard import works on every plan.
Questions
Can Vera generate tests from an OpenAPI spec?
Yes, deterministically and with no AI: one test per tag and one api-request step per operation, each checking the lowest declared 2xx status.
Does the OpenAPI importer accept YAML?
No. Convert the document to JSON first; the importer says so when it sees YAML.
Are API keys from the OpenAPI document imported?
No. Declared security schemes only produce a warning; credentials are never imported, and auth is configured in Vera.