Skip to content
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

OptionPurposeDefault
outputWhere the generated files are written and exported.{ path: 'cypress', barrel: { type: 'named' } }
↳ output.pathChoose the output folder or file.'cypress'
↳ output.modeWrite a single file or a directory of files.Inferred from output.path
↳ output.barrelConfigure barrel exports.{ type: 'named' }
↳ output.bannerAdd content before generated code.None
↳ output.footerAdd content after generated code.None
groupSplit output into per-tag or per-path folders.None
↳ group.typeGroup operations by tag or URL path.Required with group
↳ group.nameCustomize output group names.camelCased tag or raw path segment
baseURLBase URL prepended to every request.None
includeKeep only operations that match.None
excludeSkip operations that match.[]
overrideApply different options per pattern.[]
resolverCustomize generated names and file paths.resolverCypress
macrosRewrite 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.

Typestring
Requiredfalse
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)
}