description split into lines
flag that description is present
document title
document version
generate readonly properties
generate array types as Array
name of the main exported class
Optional
authorizationToken?: stringauthorisation token for private swagger schema access
remove output directory before generating
Optional
codeGenConstructs?: (struct: CodeGenConstruct) => Partial<CodeGenConstruct>customise code generation constructs
ts compiler configuration object (for --to-js option)
map of schema component references
resolver for component type names
internal constants
flag indicating the schema was converted from Swagger 2.0
Optional
customTranslator?: new () => Translatorcustom ts->* translator do not use constructor args, just send class reference
output debug messages
use "default" response status code as success response. some swagger schemas treat "default" as a successful response.
default type for empty response schema
disable throwing on a non-successful response
prefix string value for enum keys
enum key resolver name
suffix string value for enum keys
use enum names as values
extract all enums from nested types/interfaces to enum
construction
extra configuration for extracting type names operations
extract request body type to data contract
extract request params to data contract
extract response body type to data contract
extract response error type to data contract
extract all enums from inline interface/type content to typescript enum construction
extra templates
file name for the generated API module
generated file names
prefix string value needed to fix invalid enum keys
prefix string value needed to fix invalid type names
generate an API client
generate additional information about request responses and error typings
generate type definitions for API routes
generate all "enum" types as union types (T1 | T2 | TN)
hooks for customising the generation process
generated http client type
path to swagger schema
internal options for templates
generate separated files for http client, data contracts, and routes
use the first tag for the module name
determines which path index should be used for routes separation
original swagger schema
path to folder where the created api module will be placed.
may be set to false
to skip writing content to disk; in this case
the files
array on the return value will contain the generated contents.
fix up small errors in the swagger source definition
Optional
primitiveTypeConstructs?: (struct: PrimitiveTypeStruct) => Partial<PrimitiveTypeStruct>customise primitive type mappings
swagger schema type -> typescript type https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times
Optional
requestOptions?: Partial<RequestInit>configuration for fetching swagger schema requests
map of duplicate route names
Optional
schemaParsers?: {custom schema parsers
output only errors to console
ability to send HttpClient instance to Api constructor
sort routes in alphabetical order
sort data contracts in alphabetical order
swagger schema JSON
specific argument name resolver name
range of HTTP status codes treated as success
parsed swagger schema
supported template file extensions
built-in template info
templates/base
custom path to templates (--templates
)
templates/default
templates/modular
usage path if --templates
option is not set
path to folder containing custom templates
Record<templateName, templateContent>
generate js api module with declaration file
code generation constructs for TypeScript
type name resolver name
prefix string value for type names
suffix string value for type names
unwrap the data item from the response
update configuration object during generation
url to swagger schema
package version
Optional
request
base url from schema