Generator options shared by the OData and OpenApi generator.

interface CommonGeneratorOptions {
    clearOutputDir?: boolean;
    include?: string;
    input: string;
    metadata?: boolean;
    optionsPerService?: string;
    outputDir: string;
    overwrite?: boolean;
    packageJson?: boolean;
    prettierConfig?: string;
    readme?: boolean;
    skipValidation?: boolean;
    transpile?: boolean;
    tsconfig?: string;
    verbose?: boolean;
}

Hierarchy

Properties

clearOutputDir?: boolean

Delete EVERYTHING in the specified output directory before generating code.

include?: string

Include files matching the given glob into the root of each generated client directory.

input: string

Specify the path to the directory or file containing the service definition(s) to generate clients for. Throws an error if the path does not exist.

metadata?: boolean

Hidden option only for internal usage - generate metadata for API hub integration.

optionsPerService?: string

Configuration file to ensure consistent names between multiple generation runs with updated / changed metadata files. The configuration allows to set a directoryName and npmPackageName for every service, identified by the path to the original file. It also makes sure that names do not change between generator runs. If a directory is passed, a options-per-service.json file is read/created in this directory.

outputDir: string

Directory to save the generated code in.

overwrite?: boolean

Exit when encountering a file that already exists. When set to true, it will be overwritten instead. Note, that compared to the clearOutputDir option, this will not delete outdated files.

packageJson?: boolean

Generate a package.json file, specifying dependencies and scripts for compiling.

prettierConfig?: string

Specify the path to the prettier config. If not given a default config will be used for the generated sources.

readme?: boolean

Generate default README.md files in the client directories.

skipValidation?: boolean

Generation will stop if objects need renaming due to non-unique conditions or conflicts to JavaScript keywords. If you enable this option, conflicts are resolved by appending postfixes like '_1".

transpile?: boolean

When enabled, generates transpiled .js, .js.map, and .d.ts files. By default, only .ts files are generated.

tsconfig?: string

Replace the default tsconfig.json by passing a path to a custom configuration. By default, a tsconfig.json is only generated when transpilation is enabled (transpile). If a directory is passed, a tsconfig.json file is read from this directory.

verbose?: boolean

By default, only errors, warnings and important info logs will be displayed. If set to true, all logs will be displayed.

Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.