07 - Folder Variables
Purpose
Folder variables allow reusable values in request URLs without introducing cloud environment systems.
Primary use case:
- Replacing URL placeholders like
{{baseUrl}}using local folder-scoped variable files.
Variable File Format
Variables are stored in folder config YAML files:
.apifreeman-folder.yaml- legacy read fallback:
.anti-postman-folder.yaml
Document shape:
- schemaVersion: 1
- kind: folder
- variables: key/value array
See 12-file-format-reference for concrete examples.
Inheritance Model
Resolution is hierarchical:
- Start at root folder config
- Apply each nested ancestor folder config in path order
- Child values override parent values for same key
Example:
- root defines
baseUrl=https://api.prod - nested folder defines
baseUrl=https://api.staging - requests in nested folder resolve to staging value
Resolution Timing
URL variable replacement occurs in Electron main process before sending request.
Functionally:
- If
contextFolderPathexists and URL contains{{...}}, variables are resolved. - If placeholder has no matching variable, placeholder text is left unchanged.
Placeholder Syntax
Supported placeholder pattern:
{{variableName}}
Variable name character class in current regex:
- letters
- numbers
- underscore
- hyphen
Where Variables Come From
- Manual folder variable writes (current internal flow)
- Import pipeline writes (for example OpenAPI import writes
baseUrlvariable at collection folder)
Typical Usage Pattern
- Organize requests under service folder.
- Set folder variable
baseUrlfor that service. - Save URLs as
{{baseUrl}}/path. - Switch value in one place for environment changes.
Limitations
- Variable interpolation currently applies to URL, not full request body/headers.
- No expression language or nested interpolation.
- No encrypted secret vault in current implementation.