CLIKontractGenerators
← Generators

Client SDK · OpenAPI

The same client, sent through Axios.

Identical option surface to typescript-fetch. Choose it only when the consuming app already standardises on Axios interceptors.

What it emits

ModelsOperation client methodsZod schemas when enabled

Options

Options this generator adds on top of its base set. Set them under generator: in the target.

OptionDescriptionValuesDefault
envelopeWrap successful responses in a fixed shape. Set `dataKey`, and optionally `metaKey`, `staticFields`, and `contextFields` for path and timestamp.objectunset (no envelope)

Shared options

Every OpenAPI generator accepts these, so a schema choice made once stays consistent between a server and its clients.

OptionDescriptionValuesDefault
audiencesApply operation `x-kontract-audiences` policy. `exclude` is validated once against the complete selected OpenAPI source/target universe, not per generated service: siblings with no matching audience generate normally, while a token absent from the whole source fails validation and `generate --clean` preflight before deletion. NestJS may instead set `marker: true` to retain and annotate output.object (exclude: string[]; marker: true for typescript-nestjs)unset (operations belong to every audience)
zodEmit framework-neutral Zod schemas alongside the inferred request and response types.true | falsefalse
schemaModeHow faithfully the source schema is reproduced. `normalize` reshapes inline schemas into named components; `strict` keeps the document as authored.normalize | strictstrict for typescript-nestjs, normalize for SDK targets
useSingleRequestParameterCollapse an operation's parameters into one request object instead of a positional argument list.true | falsefalse
stringEnumsEmit enums as string union types rather than TypeScript `enum` declarations.true | falsefalse
enumUnknownDefaultCaseAdd a fallback member so an unrecognised wire value does not throw at the boundary.true | falsefalse
modelPropertyNamingCasing applied to model properties.camelCase | PascalCase | snake_case | originaloriginal
paramNamingCasing applied to operation parameters.camelCase | PascalCase | snake_case | originaloriginal
enumPropertyNamingCasing applied to enum members.PascalCase | camelCase | snake_case | UPPERCASE | originaloriginal
sortModelPropertiesByRequiredFlagOrder model properties with required ones first.true | falsefalse
sortParamsByRequiredFlagOrder operation parameters with required ones first.true | falsefalse

Example

sumr.yamlyaml
targets:
  - name: web-axios
    output: ./apps/web/src/api/axios
    generator:
      type: typescript-axios
      useSingleRequestParameter: true

On this page