Generation Settings
Generation Settings
Overview
This guide explains how generation settings work in the VSCode OpenAPI spec generator.
The interface is designed so that you can move from selecting a specification to choosing the generator type, adjusting language-specific options, configuring extraction, and saving those choices for later reuse.
Project Generation Settings
The extension stores its generation settings in VS Code under ai4you-openapi.projectGenerationSettings.
This is the main generation settings object exposed by the extension.
Inside this object, the extension stores saved values such as:
- the project path used for extraction
- the selected API environment
- excluded files
- saved generator configurations for specific spec and language combinations
These values are not exposed as separate top-level VS Code settings.
In practice, you normally do not need to edit this object manually because the interface updates it for you.
Example config:

Load Saved Settings
The generator can save settings for a specific combination of:
- generator type
- language
- specification path
This allows the tool to remember previous generation setups.
The saved entry is stored inside ai4you-openapi.projectGenerationSettings, rather than as a separate VS Code setting.
When you load saved settings, the generator can restore:
- the selected spec path
- the generator type
- the language
- configured generator options
- extraction settings
- the selected API environment
This makes it easier to return to the same generation flow without entering all values again.

Specification-Based Settings
Saved settings are tied to the selected OpenAPI specification.
This means that when you switch to a different spec file:
- the current generation context changes
- the tool checks for settings that belong to the new spec
- custom settings for the current in-memory flow may be reset
This behavior helps keep generator options aligned with the spec you are currently working with.
Generator Type Settings
The generator type step lets you choose whether you want to generate a client or a server.
This choice affects:
- which languages are available
- which option set is loaded
- which saved settings entry is used
Changing the generator type is treated as a meaningful configuration change, so later steps in the flow may be refreshed to match the new target.
Language and Options Settings
After selecting a generator type, you can choose a language and open the settings dialog for generator-specific options.

This area is where you control values such as:
- package names

- naming conventions
- generation switches
- other language-specific settings exposed by the generator service

The interface can also show when options are no longer at their default values, helping you see when a configuration has been customized.
Generator Version and Environment
For certain generators, the interface lets you choose a generator version or environment.
This setting controls which backend generator environment is used when requesting code generation.
Depending on the generator, this may be used to:
- select the default released environment
- try a newer environment
- use a development environment
This setting is also included in saved generation settings so that the same configuration can be reused later.

Excluded Files
The excluded files value is used during extraction.
Its purpose is to reduce the chance of overwriting files you want to keep unchanged.
In practice, excluded files are used when:
- generated output is extracted into a project path
- a matching file already exists
- the file path matches one of the exclusion patterns
This gives you more control over how generated output is applied to an existing codebase.

When Settings Reset
Some settings are intentionally reset when a major input changes.
For example, this can happen when:
- you choose a different specification
- you change the generator type
- the available language or option set changes
This behavior helps prevent mismatched settings from being applied to the wrong generation flow.