---
title: "Generates and download code. GenerationRequest input provided as request body."
method: POST
path: "/generate"
tags: ["clients", "servers", "documentation", "config"]
---

# Generates and download code. GenerationRequest input provided as request body.

`POST /generate`

## Query parameters

- `codegenOptionsURL` string, required

## Request body

- GenerationRequest
  - `lang` string, required — language to generate (required)456
  - `spec` object — spec in json format. . Alternative to `specURL`
  - `specURL` string — URL of the spec in json format. Alternative to `spec`
  - `type` 'CLIENT' | 'SERVER' | 'DOCUMENTATION' | 'CONFIG' — type of the spec
  - `codegenVersion` 'V2' | 'V3' — codegen version to use
  - `options` Options
    - `auth` string — adds authorization headers when fetching the open api definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values
    - `authorizationValue` AuthorizationValue — adds authorization headers when fetching the open api definitions remotely. Pass in an authorizationValue object
      - `value` string — Authorization value
      - `keyName` string — Authorization key
      - `type` 'query' | 'header' — Authorization type
    - `apiPackage` string — package for generated api classes
    - `templateVersion` string — template version for generation
    - `modelPackage` string — package for generated models
    - `modelNamePrefix` string — Prefix that will be prepended to all model names. Default is the empty string.
    - `modelNameSuffix` string — PrefixSuffix that will be appended to all model names. Default is the empty string.
    - `systemProperties` object — sets specified system properties in key/value format
    - `instantiationTypes` object — sets instantiation type mappings in key/value format. For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code.
    - `typeMappings` object — sets mappings between swagger spec types and generated code types in key/value format. For example: array=List,map=Map,string=String.
    - `additionalProperties` object — sets additional properties that can be referenced by the mustache templates in key/value format.
    - `languageSpecificPrimitives` string[] — specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double. You can also have multiple occurrences of this option.
    - `importMappings` object — specifies mappings between a given class and the import that should be used for that class in key/value format.
    - `invokerPackage` string — root package for generated code
    - `groupId` string — groupId in generated pom.xml
    - `artifactId` string — artifactId in generated pom.xml
    - `artifactVersion` string — artifact version generated in pom.xml
    - `library` string — library template (sub-template)
    - `gitUserId` string — Git user ID, e.g. swagger-api.
    - `gitRepoId` string — Git repo ID, e.g. swagger-codegen.
    - `releaseNote` string — Release note, default to 'Minor update'.
    - `httpUserAgent` string — HTTP user agent, e.g. codegen_csharp_api_client, default to 'Swagger-Codegen/{packageVersion}}/{language}'
    - `reservedWordsMappings` object — pecifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier.
    - `ignoreFileOverride` string — Specifies an override location for the .swagger-codegen-ignore file. Most useful on initial generation.
    - `removeOperationIdPrefix` boolean — Remove prefix of operationId, e.g. config_getId => getId
    - `skipOverride` boolean

## Response `200`

successful operation

## Changes

- **2024-06-18** `5f49a7276b84` — 1 breaking
  - added the new required `query` request parameter `codegenOptionsURL`
- **2024-06-14** `276a39435992` — 1 warning
  - deleted the `query` request parameter `codegenOptionsURL`

[Change history](https://skmtc.dev/artalkjs/apis/swagger-generator/changes/generate/post.md)

---

[API](https://skmtc.dev/artalkjs/apis/swagger-generator.md) · [All operations](https://skmtc.dev/artalkjs/apis/swagger-generator/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/artalkjs/swagger-generator/revisions/3f643df586f0/schema)
