Reference
Options
Configuration options for @kubb/plugin-cypress.
Pass these options to pluginCypress(). Shared options link to Shared plugin options, which documents their behavior once.
Options overview
| Option | Purpose | Default |
|---|---|---|
output | Where the generated files are written and exported. | { path: 'cypress', barrel: { type: 'named' } } |
↳ output.path | Choose the output folder or file. | 'cypress' |
↳ output.mode | Write a single file or a directory of files. | Inferred from output.path |
↳ output.barrel | Configure barrel exports. | { type: 'named' } |
↳ output.banner | Add content before generated code. | None |
↳ output.footer | Add content after generated code. | None |
group | Split output into per-tag or per-path folders. | None |
↳ group.type | Group operations by tag or URL path. | Required with group |
↳ group.name | Customize output group names. | camelCased tag or raw path segment |
baseURL | Base URL prepended to every request. | None |
include | Keep only operations that match. | None |
exclude | Skip operations that match. | [] |
override | Apply different options per pattern. | [] |
resolver | Customize generated names and file paths. | resolverCypress |
macros | Rewrite AST nodes before printing. | [] |
resolverCypress adds no namespaces of its own, so a resolver patch uses only the shared name, file and imports members.
Option details
baseURL
Base URL prepended to every request in the generated helpers. When omitted, no host is prepended and each helper uses the operation's relative path from the spec. The host is emitted into each helper's URL, so no runtime host setup is needed.
| Type | string |
| Required | false |
baseURL: 'https://staging.petstore.dev'
export function showPetById(
{ path }: ShowPetByIdOptions,
options: Partial<Cypress.RequestOptions> = {},
): Cypress.Chainable<ShowPetByIdResponse> {
return cy
.request<ShowPetByIdResponse>({
method: 'GET',
url: `https://staging.petstore.dev/pets/${path.petId}`,
...options,
})
.then((res) => res.body)
}