Deep-dive into hitspec's {{var}} syntax, $env() references, capture chains, and resolution order.
Variable interpolation is the mechanism that replaces {{placeholder}} expressions with actual values at runtime. This page covers all interpolation contexts, resolution rules, and advanced patterns.
GET {{baseUrl}}/users/{{login.userId}}Authorization: Bearer {{login.token}}
Resolution Order
When the same variable name exists in multiple sources, hitspec resolves in this order (later sources win):
Config environments — hitspec.yamlenvironments section for the active --env
Inline variables — @variable = value in the file
Captured values — {{requestName.captureName}}
Built-in functions ($uuid(), $timestamp(), $env(), …) and system variables ({{$VAR}}) are evaluated wherever they appear.An inline variable that references its own name, such as @baseUrl = {{baseUrl}}, resolves that reference against the lower layers (the config environment, then .env, then the OS environment). The file default therefore delegates to the environment.Captured values are inserted literally. A captured value that contains {{...}} (for example a response body with {{$env(SECRET)}}) is never expanded, so a server cannot read your local variables through a capture.
Capture Chains
Chain captures across dependent requests:
### Step 1: Login# @name loginPOST {{baseUrl}}/auth/loginContent-Type: application/json{"email": "admin@example.com", "password": "secret"}>>>capturetoken from body.access_token<<<### Step 2: Create resource# @name createResource# @depends loginPOST {{baseUrl}}/resourcesAuthorization: Bearer {{login.token}}Content-Type: application/json{"name": "New Resource"}>>>captureresourceId from body.id<<<### Step 3: Get resource# @depends createResourceGET {{baseUrl}}/resources/{{createResource.resourceId}}Authorization: Bearer {{login.token}}>>>expect status 200<<<
Step 3 references captures from both Step 1 (login.token) and Step 2 (createResource.resourceId).
Captured and interpolated non-string values are inserted as their JSON text: numbers keep their exact digits (1000000, 123456789012), booleans are true or false, null is null, and objects and arrays are compact JSON.
Unresolved Variables
If a variable cannot be resolved, it remains as the literal {{variableName}} string in the request. hitspec does not error on unresolved variables — the request is sent with the raw placeholder, which typically causes a server-side error that surfaces through your assertions.
Use --verbose (or -v) to see resolved variable values in the output, which helps debug interpolation issues.
Last modified on October 19, 2026
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"hitspec","description":"hitspec is a file-based HTTP API testing tool. Write API tests as plain-text .http files, run them with 26 assertion operators, capture and chain requests, stress-test, mock, and verify database state — no SDK, no GUI, no JavaScript.","colors":{"primary":"#88C0D0","light":"#8FBCBB","dark":"#5E81AC"},"logo":{"light":"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/logo/light.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=b041ab9cc5b38b53110611b1c3e3435d","dark":"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/logo/dark.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=d9a717f6f6d804685a15907aa0d1f27e"},"favicon":"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/favicon.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=1f9aa7e4e0e34f5f9afb23c4165d8673","navbar":{"links":[{"href":"https://github.com/abdul-hamid-achik/hitspec","label":"GitHub"},{"href":"https://github.com/abdul-hamid-achik/hitspec/blob/main/CHANGELOG.md","label":"Changelog"}],"primary":{"type":"button","label":"Install","href":"/installation"}},"footer":{"socials":{"github":"https://github.com/abdul-hamid-achik/hitspec"}},"search":{"prompt":"Search the docs, syntax, and CLI…"},"seo":{"metatags":{"og:site_name":"hitspec","og:type":"website","og:locale":"en_US","twitter:card":"summary_large_image","theme-color":"#88C0D0","canonical":"https://hitspec.dev","robots":"index, follow","revisit-after":"7 days","language":"en"},"indexing":"navigable"},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"global":{"tabs":[{"tab":"Documentation","href":"/introduction"},{"tab":"Guides","href":"/guides"},{"tab":"Reference","href":"/reference"},{"tab":"Examples","href":"/examples"}],"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/abdul-hamid-achik/hitspec"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fuego-45a05047","hasAudioNarration":false,"actualSubdomain":"fuego-45a05047","customDomains":["hitspec.dev"],"gitSource":{"type":"github","owner":"abdul-hamid-achik","repo":"hitspec","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ad6611a7c2363fd57cca63a","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Features","count":17},{"language":"default","tag":"CLI Reference","count":13},{"language":"default","tag":"Guides","count":9},{"language":"default","tag":"Examples","count":8},{"language":"default","tag":"Core Concepts","count":7},{"language":"default","tag":"Getting Started","count":6},{"language":"default","tag":"Integrations","count":6},{"language":"default","tag":"Assertions Reference","count":2},{"language":"default","tag":"Configuration","count":2},{"language":"default","tag":"Authentication","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"landing.css","content":".hs-hero{position:relative;overflow:hidden;padding:6rem 1.5rem 4rem;background:radial-gradient(1200px 600px at 50% -10%, rgba(136, 192, 208, 0.18), transparent 60%),\n radial-gradient(800px 500px at 85% 10%, rgba(94, 129, 172, 0.16), transparent 55%),\n radial-gradient(700px 500px at 10% 20%, rgba(143, 188, 187, 0.14), transparent 55%)}@media (prefers-color-scheme: dark){.hs-hero{background:radial-gradient(1200px 600px at 50% -10%, rgba(136, 192, 208, 0.16), transparent 60%),\n radial-gradient(800px 500px at 85% 10%, rgba(94, 129, 172, 0.22), transparent 55%),\n radial-gradient(700px 500px at 10% 20%, rgba(143, 188, 187, 0.10), transparent 55%)}}.hs-hero::before{content:\"\";position:absolute;inset:0;background-image:linear-gradient(to right, rgba(136, 192, 208, 0.06) 1px, transparent 1px),\n linear-gradient(to bottom, rgba(136, 192, 208, 0.06) 1px, transparent 1px);background-size:48px 48px;mask-image:radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 80%);-webkit-mask-image:radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 80%);pointer-events:none}.hs-hero-inner{position:relative;max-width:72rem;margin:0 auto}.hs-badge{display:inline-flex;align-items:center;gap:0.5rem;padding:0.3rem 0.9rem;border-radius:999px;font-size:0.8rem;font-weight:500;letter-spacing:0.01em;color:#2e3440;background:rgba(136, 192, 208, 0.16);border:1px solid rgba(136, 192, 208, 0.35);backdrop-filter:blur(6px)}@media (prefers-color-scheme: dark){.hs-badge{color:#e5e9f0;background:rgba(136, 192, 208, 0.10);border:1px solid rgba(136, 192, 208, 0.25)}}.hs-badge-dot{width:0.5rem;height:0.5rem;border-radius:999px;background:#88c0d0;box-shadow:0 0 0 0 rgba(136, 192, 208, 0.7);animation:hs-pulse 2s infinite}@keyframes hs-pulse{0%{box-shadow:0 0 0 0 rgba(136, 192, 208, 0.6)}70%{box-shadow:0 0 0 8px rgba(136, 192, 208, 0)}100%{box-shadow:0 0 0 0 rgba(136, 192, 208, 0)}}.hs-headline{font-size:clamp(2.5rem, 6vw, 4.75rem);line-height:1.05;font-weight:700;letter-spacing:-0.02em;margin:1.25rem 0 0}.hs-gradient-text{background:linear-gradient(110deg, #5e81ac 0%, #88c0d0 45%, #8fbcbb 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.hs-subhead{font-size:clamp(1.05rem, 2.2vw, 1.35rem);line-height:1.6;max-width:42rem;margin:1.5rem 0 0;color:#4c566a}@media (prefers-color-scheme: dark){.hs-subhead{color:#aeb6c6}}.hs-cta-row{display:flex;flex-wrap:wrap;gap:0.75rem;margin-top:2rem;align-items:center}.hs-btn{display:inline-flex;align-items:center;gap:0.5rem;padding:0.7rem 1.4rem;border-radius:0.75rem;font-weight:600;font-size:0.95rem;text-decoration:none;transition:transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease}.hs-btn-primary{color:#1b1f2a;background:linear-gradient(135deg, #88c0d0 0%, #8fbcbb 100%);box-shadow:0 10px 30px -10px rgba(136, 192, 208, 0.65)}.hs-btn-primary:hover{transform:translateY(-2px);box-shadow:0 16px 38px -12px rgba(136, 192, 208, 0.8)}@media (prefers-color-scheme: dark){.hs-btn-primary{color:#0d1117;background:linear-gradient(135deg, #88c0d0 0%, #a3d3df 100%)}}.hs-btn-ghost{color:#2e3440;background:rgba(46, 52, 64, 0.04);border:1px solid rgba(46, 52, 64, 0.18)}.hs-btn-ghost:hover{transform:translateY(-2px);background:rgba(46, 52, 64, 0.08)}@media (prefers-color-scheme: dark){.hs-btn-ghost{color:#e5e9f0;background:rgba(229, 233, 240, 0.04);border:1px solid rgba(229, 233, 240, 0.18)}.hs-btn-ghost:hover{background:rgba(229, 233, 240, 0.08)}}.hs-install-chip{display:inline-flex;align-items:center;gap:0.6rem;margin-top:1.5rem;padding:0.6rem 1rem;border-radius:0.6rem;font-family:ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace;font-size:0.9rem;color:#2e3440;background:rgba(46, 52, 64, 0.05);border:1px solid rgba(46, 52, 64, 0.12)}@media (prefers-color-scheme: dark){.hs-install-chip{color:#d8dee9;background:rgba(216, 222, 233, 0.05);border:1px solid rgba(216, 222, 233, 0.12)}}.hs-install-chip code{background:transparent;border:none;padding:0;font-size:inherit}.hs-window{margin-top:2.5rem;border-radius:0.9rem;overflow:hidden;border:1px solid rgba(46, 52, 64, 0.14);background:#f6f8fa;box-shadow:0 24px 60px -28px rgba(46, 52, 64, 0.45)}@media (prefers-color-scheme: dark){.hs-window{border-color:rgba(216, 222, 233, 0.12);background:#161a23;box-shadow:0 24px 60px -28px rgba(0, 0, 0, 0.7)}}.hs-window-bar{display:flex;align-items:center;gap:0.45rem;padding:0.65rem 0.9rem;border-bottom:1px solid rgba(46, 52, 64, 0.10);background:rgba(46, 52, 64, 0.03)}@media (prefers-color-scheme: dark){.hs-window-bar{border-bottom-color:rgba(216, 222, 233, 0.10);background:rgba(216, 222, 233, 0.03)}}.hs-dot{width:0.75rem;height:0.75rem;border-radius:999px}.hs-dot-r{background:#ff5f57}.hs-dot-y{background:#febc2e}.hs-dot-g{background:#28c840}.hs-window-title{margin-left:0.5rem;font-size:0.78rem;color:#6b7280;font-family:ui-monospace, SFMono-Regular, Menlo, monospace}@media (prefers-color-scheme: dark){.hs-window-title{color:#8b93a7}}.hs-window pre{margin:0;padding:1.1rem 1.25rem;overflow-x:auto;font-family:ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, monospace;font-size:0.86rem;line-height:1.7;background:transparent!important}.hs-stats{display:grid;grid-template-columns:repeat(2, 1fr);gap:1rem;max-width:72rem;margin:0 auto;padding:0 1.5rem 3rem}@media (min-width: 768px){.hs-stats{grid-template-columns:repeat(4, 1fr)}}.hs-stat{text-align:center;padding:1.25rem 0.5rem;border-radius:0.85rem;border:1px solid rgba(46, 52, 64, 0.10);background:rgba(136, 192, 208, 0.05)}@media (prefers-color-scheme: dark){.hs-stat{border-color:rgba(216, 222, 233, 0.10);background:rgba(136, 192, 208, 0.05)}}.hs-stat-num{font-size:1.9rem;font-weight:700;line-height:1}.hs-stat-label{margin-top:0.4rem;font-size:0.82rem;color:#6b7280}@media (prefers-color-scheme: dark){.hs-stat-label{color:#8b93a7}}.hs-section{max-width:72rem;margin:0 auto;padding:3rem 1.5rem}.hs-eyebrow{text-transform:uppercase;letter-spacing:0.12em;font-size:0.78rem;font-weight:600;color:#5e81ac}.hs-h2{font-size:clamp(1.75rem, 3.5vw, 2.5rem);font-weight:700;letter-spacing:-0.015em;margin:0.5rem 0 0.5rem}.hs-lead{max-width:40rem;color:#4c566a;font-size:1.05rem;line-height:1.6}@media (prefers-color-scheme: dark){.hs-lead{color:#aeb6c6}}.hs-grid{display:grid;gap:1rem;grid-template-columns:1fr}@media (min-width: 640px){.hs-grid{grid-template-columns:repeat(2, 1fr)}}@media (min-width: 1024px){.hs-grid{grid-template-columns:repeat(3, 1fr)}}.hs-feature{display:block;padding:1.4rem;border-radius:0.9rem;border:1px solid rgba(46, 52, 64, 0.10);background:rgba(255, 255, 255, 0.6);text-decoration:none;transition:transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;backdrop-filter:blur(4px)}.hs-feature:hover{transform:translateY(-3px);border-color:rgba(136, 192, 208, 0.55);box-shadow:0 18px 40px -22px rgba(94, 129, 172, 0.45)}@media (prefers-color-scheme: dark){.hs-feature{border-color:rgba(216, 222, 233, 0.10);background:rgba(229, 233, 240, 0.03)}.hs-feature:hover{border-color:rgba(136, 192, 208, 0.55)}}.hs-feature-ico{width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;border-radius:0.7rem;font-size:1.1rem;background:linear-gradient(135deg, rgba(136, 192, 208, 0.25), rgba(94, 129, 172, 0.18));margin-bottom:0.85rem}.hs-feature-title{font-weight:600;font-size:1.02rem;color:#2e3440;margin:0}@media (prefers-color-scheme: dark){.hs-feature-title{color:#e5e9f0}}.hs-feature-desc{margin-top:0.4rem;font-size:0.9rem;line-height:1.55;color:#6b7280}@media (prefers-color-scheme: dark){.hs-feature-desc{color:#9ba3b3}}.hs-compare{width:100%;border-collapse:separate;border-spacing:0;font-size:0.92rem}.hs-compare th,.hs-compare td{padding:0.7rem 0.9rem;text-align:left;border-bottom:1px solid rgba(46, 52, 64, 0.08)}@media (prefers-color-scheme: dark){.hs-compare th,.hs-compare td{border-bottom-color:rgba(216, 222, 233, 0.08)}}.hs-compare th{font-weight:600;color:#2e3440;background:rgba(136, 192, 208, 0.06)}@media (prefers-color-scheme: dark){.hs-compare th{color:#e5e9f0}}.hs-compare tr:last-child td{border-bottom:none}.hs-yes{color:#28a745;font-weight:600}.hs-no{color:#9ba3b3}.hs-band{position:relative;overflow:hidden;padding:3.5rem 1.5rem;border-radius:1.25rem;max-width:72rem;margin:2rem auto;background:linear-gradient(135deg, rgba(94, 129, 172, 0.10), rgba(136, 192, 208, 0.08)),\n rgba(255, 255, 255, 0.5);border:1px solid rgba(136, 192, 208, 0.25)}@media (prefers-color-scheme: dark){.hs-band{background:linear-gradient(135deg, rgba(94, 129, 172, 0.16), rgba(136, 192, 208, 0.06)),\n rgba(229, 233, 240, 0.03);border-color:rgba(136, 192, 208, 0.20)}}.hs-final{position:relative;overflow:hidden;text-align:center;padding:5rem 1.5rem;max-width:72rem;margin:2rem auto 4rem;border-radius:1.5rem;background:radial-gradient(600px 300px at 50% 0%, rgba(136, 192, 208, 0.30), transparent 70%),\n linear-gradient(135deg, #5e81ac 0%, #88c0d0 100%);color:#fff}@media (prefers-color-scheme: dark){.hs-final{background:radial-gradient(600px 300px at 50% 0%, rgba(136, 192, 208, 0.35), transparent 70%),\n linear-gradient(135deg, #4c5e87 0%, #7fb3c4 100%);color:#0d1117}}.hs-final h2{font-size:clamp(1.8rem, 4vw, 2.75rem);font-weight:700;letter-spacing:-0.015em;margin:0}.hs-final p{margin:1rem auto 0;max-width:36rem;font-size:1.08rem;opacity:0.95}.hs-final .hs-btn-primary{background:#fff;color:#1b1f2a;box-shadow:0 12px 34px -12px rgba(0, 0, 0, 0.45)}.hs-final .hs-btn-primary:hover{background:#f6f8fa}.hs-faq{max-width:48rem;margin:0 auto;padding:1rem 1.5rem 3rem}body:has(.hs-hero) #page-title{display:none}"}],"page":{"pagePath":"concepts/variable-interpolation","slug":"/concepts/variable-interpolation","pageMetadata":{"title":"Variable Interpolation","description":"Deep-dive into hitspec's {{var}} syntax, $env() references, capture chains, and resolution order.","href":"/concepts/variable-interpolation"},"description":"Deep-dive into hitspec's {{var}} syntax, $env() references, capture chains, and resolution order.","pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Variable interpolation is the mechanism that replaces `,_jsx(_components.code,{children:`{{placeholder}}`}),` expressions with actual values at runtime. This page covers all interpolation contexts, resolution rules, and advanced patterns.`]}),`\n`,_jsx(Heading,{level:`2`,id:`interpolation-syntax`,children:`Interpolation Syntax`}),`\n`,_jsx(_components.p,{children:`All interpolation uses double curly braces:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`{{variableName}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`where-interpolation-works`,children:`Where Interpolation Works`}),`\n`,_jsx(_components.p,{children:`Variables can appear in:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Context`}),_jsx(_components.th,{children:`Example`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`URLs`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`GET {{baseUrl}}/users/{{userId}}`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Headers`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization: Bearer {{token}}`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Request bodies`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{\"name\": \"{{userName}}\"}`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Query parameters`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`? key = {{apiKey}}`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Assertion values`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`expect body.name == \"{{expectedName}}\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Variable definitions`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`@apiPath = {{baseUrl}}/v1`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Metadata directives`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`# @auth bearer {{token}}`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Metadata arguments`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`# @timeout {{timeoutMs}}`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`variable-sources`,children:`Variable Sources`}),`\n`,_jsx(Heading,{level:`3`,id:`inline-variables`,children:`Inline Variables`}),`\n`,_jsxs(_components.p,{children:[`Defined at the top of a `,_jsx(_components.code,{children:`.http`}),` file:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`baseUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`https://api.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`my-secret-token`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`v2`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`environment-variables`,children:`Environment Variables`}),`\n`,_jsxs(_components.p,{children:[`From `,_jsx(_components.code,{children:`hitspec.yaml`}),` environments section:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`environments`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` dev`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` baseUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`http://localhost:3000`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`dev-token`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`system-environment-variables`,children:`System Environment Variables`}),`\n`,_jsxs(_components.p,{children:[`Using the `,_jsx(_components.code,{children:`$env()`}),` function:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`{{$env(API_TOKEN)}}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`dbUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`{{$env(DATABASE_URL, sqlite://./test.db)}}`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`built-in-functions`,children:`Built-in Functions`}),`\n`,_jsx(_components.p,{children:`Dynamic values generated at runtime:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{{$uuid()}}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"timestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`{$timestamp()`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{{$randomEmail()}}\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`captured-values`,children:`Captured Values`}),`\n`,_jsx(_components.p,{children:`Values extracted from prior responses:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`GET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {{baseUrl}}/users/{{login.userId}}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer {{login.token}}`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`resolution-order`,children:`Resolution Order`}),`\n`,_jsx(_components.p,{children:`When the same variable name exists in multiple sources, hitspec resolves in this order (later sources win):`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Config environments`}),` — `,_jsx(_components.code,{children:`hitspec.yaml`}),` `,_jsx(_components.code,{children:`environments`}),` section for the active `,_jsx(_components.code,{children:`--env`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Inline variables`}),` — `,_jsx(_components.code,{children:`@variable = value`}),` in the file`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Captured values`}),` — `,_jsx(_components.code,{children:`{{requestName.captureName}}`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Built-in functions (`,_jsx(_components.code,{children:`$uuid()`}),`, `,_jsx(_components.code,{children:`$timestamp()`}),`, `,_jsx(_components.code,{children:`$env()`}),`, …) and system variables (`,_jsx(_components.code,{children:`{{$VAR}}`}),`) are evaluated wherever they appear.`]}),`\n`,_jsxs(_components.p,{children:[`An inline variable that references its own name, such as `,_jsx(_components.code,{children:`@baseUrl = {{baseUrl}}`}),`, resolves that reference against the lower layers (the config environment, then `,_jsx(_components.code,{children:`.env`}),`, then the OS environment). The file default therefore delegates to the environment.`]}),`\n`,_jsxs(_components.p,{children:[`Captured values are inserted literally. A captured value that contains `,_jsx(_components.code,{children:`{{...}}`}),` (for example a response body with `,_jsx(_components.code,{children:`{{$env(SECRET)}}`}),`) is never expanded, so a server cannot read your local variables through a capture.`]}),`\n`,_jsx(Heading,{level:`2`,id:`capture-chains`,children:`Capture Chains`}),`\n`,_jsx(_components.p,{children:`Chain captures across dependent requests:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`34`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`34`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`### Step 1: Login`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`@name`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` login`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {{baseUrl}}/auth/login`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Content-Type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` application/json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"admin@example.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"password\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"secret\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`>>>capture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`token from body.access_token`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c\u003c\u003c`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`### Step 2: Create resource`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`@name`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` createResource`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# @depends login`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {{baseUrl}}/resources`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer {{login.token}}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Content-Type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` application/json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"New Resource\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`>>>capture`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resourceId from body.id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c\u003c\u003c`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`### Step 3: Get resource`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# @depends createResource`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`GET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {{baseUrl}}/resources/{{createResource.resourceId}}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer {{login.token}}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`expect status 200`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c\u003c\u003c`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Step 3 references captures from both Step 1 (`,_jsx(_components.code,{children:`login.token`}),`) and Step 2 (`,_jsx(_components.code,{children:`createResource.resourceId`}),`).`]}),`\n`,_jsx(Heading,{level:`2`,id:`nested-interpolation`,children:`Nested Interpolation`}),`\n`,_jsx(_components.p,{children:`Variables can reference other variables:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`baseUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`https://api.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiPath`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`{{baseUrl}}/v2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`usersEndpoint`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`{{apiPath}}/users`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`GET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {{usersEndpoint}}`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Captured and interpolated non-string values are inserted as their JSON text: numbers keep their exact digits (`,_jsx(_components.code,{children:`1000000`}),`, `,_jsx(_components.code,{children:`123456789012`}),`), booleans are `,_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),`, `,_jsx(_components.code,{children:`null`}),` is `,_jsx(_components.code,{children:`null`}),`, and objects and arrays are compact JSON.`]}),`\n`,_jsx(Heading,{level:`2`,id:`unresolved-variables`,children:`Unresolved Variables`}),`\n`,_jsxs(_components.p,{children:[`If a variable cannot be resolved, it remains as the literal `,_jsx(_components.code,{children:`{{variableName}}`}),` string in the request. hitspec does not error on unresolved variables — the request is sent with the raw placeholder, which typically causes a server-side error that surfaces through your assertions.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`--verbose`}),` (or `,_jsx(_components.code,{children:`-v`}),`) to see resolved variable values in the output, which helps debug interpolation issues.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Variable Interpolation","description":"Deep-dive into hitspec's {{var}} syntax, $env() references, capture chains, and resolution order.","href":"/concepts/variable-interpolation"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Interpolation Syntax","slug":"interpolation-syntax","depth":2,"children":[]},{"title":"Where Interpolation Works","slug":"where-interpolation-works","depth":2,"children":[]},{"title":"Variable Sources","slug":"variable-sources","depth":2,"children":[{"title":"Inline Variables","slug":"inline-variables","depth":3,"children":[]},{"title":"Environment Variables","slug":"environment-variables","depth":3,"children":[]},{"title":"System Environment Variables","slug":"system-environment-variables","depth":3,"children":[]},{"title":"Built-in Functions","slug":"built-in-functions","depth":3,"children":[]},{"title":"Captured Values","slug":"captured-values","depth":3,"children":[]}]},{"title":"Resolution Order","slug":"resolution-order","depth":2,"children":[]},{"title":"Capture Chains","slug":"capture-chains","depth":2,"children":[]},{"title":"Nested Interpolation","slug":"nested-interpolation","depth":2,"children":[]},{"title":"Unresolved Variables","slug":"unresolved-variables","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"fuego-45a05047","siteName":"hitspec","title":"Variable Interpolation - hitspec","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-19T10:13:11.123Z","gitLastModified":"2026-10-19T10:12:54.000Z","originalFileLocation":"concepts/variable-interpolation.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Deep-dive into hitspec\u0026#x27;s {{var}} syntax, $env() references, capture chains, and resolution order.\">\u003cmeta data-mint-head name=\"application-name\" content=\"hitspec\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Variable Interpolation - hitspec\">\u003cmeta data-mint-head property=\"og:description\" content=\"Deep-dive into hitspec\u0026#x27;s {{var}} syntax, $env() references, capture chains, and resolution order.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"hitspec\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://hitspec.dev/concepts/variable-interpolation\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fuego-45a05047.mintlify.site/_mintlify/api/og/v2?division=Core+Concepts\u0026amp;title=Variable+Interpolation\u0026amp;description=Deep-dive+into+hitspec%27s+%7B%7Bvar%7D%7D+syntax%2C+%24env%28%29+references%2C+capture+chains%2C+and+resolution+order.\u0026amp;theme=93275042a6aa6480dea6ccca\u0026amp;signature=04d038e31df5d5a85bb7374175d74faa9a1df51790a8f36dd4d3cbfaafb8e481\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Variable Interpolation - hitspec\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Deep-dive into hitspec\u0026#x27;s {{var}} syntax, $env() references, capture chains, and resolution order.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fuego-45a05047.mintlify.site/_mintlify/api/og/v2?division=Core+Concepts\u0026amp;title=Variable+Interpolation\u0026amp;description=Deep-dive+into+hitspec%27s+%7B%7Bvar%7D%7D+syntax%2C+%24env%28%29+references%2C+capture+chains%2C+and+resolution+order.\u0026amp;theme=93275042a6aa6480dea6ccca\u0026amp;signature=04d038e31df5d5a85bb7374175d74faa9a1df51790a8f36dd4d3cbfaafb8e481\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/fuego-45a05047/7VaIAxtBvFB9MH3u/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"hitspec\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#88C0D0\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"theme-color\" content=\"#88C0D0\">\u003cmeta data-mint-head name=\"revisit-after\" content=\"7 days\">\u003cmeta data-mint-head name=\"language\" content=\"en\">\u003clink data-mint-head rel=\"canonical\" href=\"https://hitspec.dev/concepts/variable-interpolation\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/concepts/variable-interpolation.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://hitspec.dev/#organization\",\"name\":\"hitspec\",\"url\":\"https://hitspec.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/fuego-45a05047/A4gbvCUx3th6_k6y/logo/light.svg?fit=max\u0026auto=format\u0026n=A4gbvCUx3th6_k6y\u0026q=85\u0026s=b041ab9cc5b38b53110611b1c3e3435d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://hitspec.dev#website\",\"name\":\"hitspec\",\"url\":\"https://hitspec.dev\",\"publisher\":{\"@id\":\"https://hitspec.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://hitspec.dev/concepts/variable-interpolation#webpage\",\"url\":\"https://hitspec.dev/concepts/variable-interpolation\",\"name\":\"Variable Interpolation\",\"description\":\"Deep-dive into hitspec's {{var}} syntax, $env() references, capture chains, and resolution order.\",\"dateModified\":\"2026-10-19T10:12:54.000Z\",\"isPartOf\":{\"@id\":\"https://hitspec.dev#website\"},\"breadcrumb\":{\"@id\":\"https://hitspec.dev/concepts/variable-interpolation#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://hitspec.dev/concepts/variable-interpolation#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Core Concepts\",\"item\":\"https://hitspec.dev/concepts/file-format\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Variable Interpolation\",\"item\":\"https://hitspec.dev/concepts/variable-interpolation\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://hitspec.dev/concepts/variable-interpolation#article\",\"headline\":\"Variable Interpolation\",\"name\":\"Variable Interpolation\",\"description\":\"Deep-dive into hitspec's {{var}} syntax, $env() references, capture chains, and resolution order.\",\"url\":\"https://hitspec.dev/concepts/variable-interpolation\",\"mainEntityOfPage\":{\"@id\":\"https://hitspec.dev/concepts/variable-interpolation#webpage\"},\"dateModified\":\"2026-10-19T10:12:54.000Z\",\"publisher\":{\"@id\":\"https://hitspec.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://hitspec.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"hitspec\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"hitspec\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/concepts/variable-interpolation.md","siteName":"hitspec","nav":{"global":{"tabs":[{"tab":"Documentation","href":"/introduction"},{"tab":"Guides","href":"/guides"},{"tab":"Reference","href":"/reference"},{"tab":"Examples","href":"/examples"}],"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/abdul-hamid-achik/hitspec"}]},"groups":[{"group":"Getting Started","pages":[{"title":"hitspec — Plain text API tests. No magic.","mode":"custom","href":"/introduction"},{"title":"Install hitspec — Homebrew, Go, and binary","href":"/installation"},{"title":"Write and run your first API test in under a minute","href":"/quickstart"},{"title":"hitspec studio — a keyboard-first terminal API client","href":"/studio"},{"title":"hitspec Studio desktop — a native GUI for .http files","href":"/desktop"},{"title":"Editor Setup","href":"/editor-setup"}]},{"group":"Core Concepts","pages":[{"title":"The .http file format for API tests","href":"/concepts/file-format"},{"title":"Variables","description":"Define variables, use built-in functions, reference environment values, and interpolate captured data.","href":"/concepts/variables"},{"title":"Variable Interpolation","href":"/concepts/variable-interpolation"},{"title":"Assertions","description":"Validate HTTP responses with 26 assertion operators covering equality, strings, types, arrays, schemas, and snapshots.","href":"/concepts/assertions"},{"title":"Captures","href":"/concepts/captures"},{"title":"Dependencies","href":"/concepts/dependencies"},{"title":"Environments","href":"/concepts/environments"}]},{"group":"Features","pages":[{"title":"Authentication for API tests (@auth)","href":"/features/authentication"},{"title":"Multipart and GraphQL","href":"/features/multipart-graphql"},{"title":"TLS, cookies and HTTP options","href":"/features/tls-and-cookies"},{"title":"Snapshot testing for API responses","href":"/features/snapshot-testing"},{"title":"Load and stress test APIs with hitspec","href":"/features/stress-testing"},{"title":"Database assertions after HTTP requests","href":"/features/database-assertions"},{"title":"Shell Commands","href":"/features/shell-commands"},{"title":"Hooks","href":"/features/hooks"},{"title":"Server-Sent Events (SSE)","href":"/features/sse"},{"title":"API Coverage","href":"/features/api-coverage"},{"title":"Mock server from .http files","href":"/features/mock-server"},{"title":"Contract Testing","href":"/features/contract-testing"},{"title":"Recording Proxy","href":"/features/recording-proxy"},{"title":"Watch Mode","href":"/features/watch-mode"},{"title":"Parallel Execution","href":"/features/parallel-execution"},{"title":"Notifications","href":"/features/notifications"},{"title":"Metrics Export","href":"/features/metrics-export"}]},{"group":"Guides","pages":[{"title":"hitspec studio","icon":"terminal","href":"/guides/api-client-manager"},{"title":"CI/CD Pipeline Integration","href":"/guides/ci-cd-pipeline"},{"title":"Regression Testing with hitspec diff","href":"/guides/regression-testing"},{"title":"Database Testing Guide","href":"/guides/database-testing"},{"title":"Load Testing Guide","href":"/guides/load-testing"},{"title":"Contract Testing Guide","href":"/guides/contract-testing"},{"title":"Migrate from Postman to hitspec .http tests","href":"/guides/migrating-from-postman"},{"title":"Upgrading","icon":"arrow-up","href":"/guides/upgrading"},{"title":"Troubleshooting","icon":"wrench","href":"/guides/troubleshooting"}]},{"group":"Examples","pages":[{"title":"Basic CRUD","href":"/examples/basic-crud"},{"title":"Auth Flow","href":"/examples/auth-flow"},{"title":"GraphQL","href":"/examples/graphql"},{"title":"CI/CD Integration","href":"/examples/ci-cd"},{"title":"Stress Testing","href":"/examples/stress-testing"},{"title":"Database Assertions","href":"/examples/database-assertions"},{"title":"Contract Testing","href":"/examples/contract-testing"},{"title":"Mock Server","href":"/examples/mock-server"}]},{"group":"CLI Reference","pages":[{"title":"hitspec run","href":"/reference/run"},{"title":"hitspec validate \u0026 list","href":"/reference/validate-list"},{"title":"hitspec init","href":"/reference/init"},{"title":"hitspec import \u0026 export","href":"/reference/import-export"},{"title":"hitspec mock \u0026 record","href":"/reference/mock-record"},{"title":"hitspec contract \u0026 diff","href":"/reference/contract-diff"},{"title":"hitspec docs, studio \u0026 serve","href":"/reference/docs-serve"},{"title":"Fetch responses","href":"/reference/fetch"},{"title":"MCP client and server","href":"/reference/mcp"},{"title":"REST API","icon":"code","href":"/reference/rest-api"},{"title":"hitspec completion","href":"/reference/completion"},{"title":"hitspec version","href":"/reference/version"},{"title":"Exit Codes","href":"/reference/exit-codes"}]},{"group":"Configuration","pages":[{"title":"Configuration Reference","href":"/reference/configuration"},{"title":"Environment Variables","href":"/reference/environment-variables"}]},{"group":"Assertions Reference","pages":[{"title":"Assertion Operators","href":"/reference/assertion-operators"},{"title":"Assertion Subjects","href":"/reference/assertion-subjects"}]},{"group":"Built-in Functions","pages":[{"title":"Built-in Functions","href":"/reference/builtin-functions"}]},{"group":"Authentication","pages":[{"title":"Authentication Types","href":"/reference/auth-types"}]},{"group":"Output Formats","pages":[{"title":"Output Formats","href":"/reference/output-formats"}]},{"group":"Integrations","pages":[{"title":"GitHub Actions","href":"/integrations/github-actions"},{"title":"Output Formats","href":"/integrations/output-formats"},{"title":"Prometheus","href":"/integrations/prometheus"},{"title":"DataDog","href":"/integrations/datadog"},{"title":"Slack \u0026 Teams Notifications","href":"/integrations/slack-teams"},{"title":"Agent artifact workflow","href":"/integrations/agent-artifacts"}]}]},"basePath":"","title":"Variable Interpolation - hitspec","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}