diff --git a/api-docs/auto-generate-docs.mdx b/api-docs/auto-generate-docs.mdx index bb4cae07..8efe3818 100644 --- a/api-docs/auto-generate-docs.mdx +++ b/api-docs/auto-generate-docs.mdx @@ -11,11 +11,13 @@ Bruno allows you to automatically generate a standalone HTML documentation file ![Click Generate Docs](/images/screenshots/send-request/api-docs/opencollection/1-click-generate-docs.webp) -2. Click the **Generate** button to create the HTML documentation +2. Choose which environments to include in the generated docs. By default all environments in the collection are selected; use the **Select All** checkbox or the per-environment checkboxes to scope the output (for example, to keep `local` or `staging` envs out of docs shared externally). The configuration card alongside the list shows the normalized collection version and the number of folders and requests that will be exported. + +3. Click the **Generate** button to create the HTML documentation ![Click Generate Button](/images/screenshots/send-request/api-docs/opencollection/click-generate-2-button.webp) -3. Bruno will generate a HTML documentation file for your collection documentation +4. Bruno will generate a HTML documentation file for your collection documentation ![Generated HTML Documentation](/images/screenshots/send-request/api-docs/opencollection/genarated-docs-htmml.webp) diff --git a/variables/overview.mdx b/variables/overview.mdx index d0b72637..1ee85efa 100644 --- a/variables/overview.mdx +++ b/variables/overview.mdx @@ -127,9 +127,44 @@ Once colors are assigned, they appear in multiple places throughout the interfac This visual system helps prevent mistakes when switching between development, staging, and production environments, especially in fast-paced workflows. -### Variable Data Type +### Variable Data Types -All variables are stored as strings. Bruno does not infer or change the data type of the variable based on the value you set. + + Typed variables are available in v3.1.0+. Earlier versions stored every variable as a string. + + +Environment, collection, folder, and request variables can be tagged with a data type so they preserve their intended JavaScript type when used in requests and scripts. The supported types are: + +- `string` (default) +- `number` +- `boolean` +- `object` + +#### Setting the data type from the UI + +Open the variables table (collection, folder, request, or environment settings) and use the type selector next to the value to switch between `string`, `number`, `boolean`, and `object`. Bruno coerces the entered text to the selected type at read time and shows a warning if the value can't be parsed as that type. + +#### How types are stored in `.bru` files + +Non-string types are persisted as an annotation prefix on the line above the variable. The default `string` type has no annotation. + +```bash filename="environments/local.bru" +vars { + host: http://localhost:8787 + @number + port: 8787 + @boolean + debug: true + @object + feature_flags: {"newUi":true,"beta":false} +} +``` + +The same annotation syntax applies to `vars`, `vars:pre-request`, and `vars:post-response` blocks inside collection, folder, and request `.bru` files. + +#### Inference from scripts + +When a script sets a variable to a non-string value (for example `bru.setEnvVar('port', 8787)`), Bruno infers the appropriate data type from the value and persists it alongside the variable. ### Debugging Variables in Console