You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sling uses `${...}` syntax for embedding expressions and accessing variables within YAML strings. Expressions are evaluated using the `goval` library with custom functions.
332
+
Sling uses `{...}` syntax for embedding expressions and accessing variables within YAML strings. Expressions are evaluated using the `goval` library with custom functions.
- `secrets`: Sensitive credentials passed to Sling (e.g., `{secrets.api_key}`).
337
337
- `state`: Variables defined in `defaults.state` or `endpoints.<name>.state`. These are local to each endpoint iteration and can be updated by pagination (`next_state`) or processors (`output: state.<var>`).
338
-
- `sync`: Persistent state variables read at the start of an endpoint run (values from the previous run's `state` matching the `sync` list). Use `${coalesce(sync.var, state.var, default_value)}`.
339
-
- `auth`: Authentication data after successful authentication (e.g., `${auth.token}` for OAuth2 access tokens, refresh tokens stored here).
338
+
- `sync`: Persistent state variables read at the start of an endpoint run (values from the previous run's `state` matching the `sync` list). Use `{coalesce(sync.var, state.var, default_value)}`.
339
+
- `auth`: Authentication data after successful authentication (e.g., `{auth.token}` for OAuth2 access tokens, refresh tokens stored here).
340
340
- `request`: Information about the current HTTP request being made (available in rule/pagination evaluation). Includes `request.url`, `request.method`, `request.headers`, `request.payload`, `request.attempts`.
341
341
- `response`: Information about the HTTP response received (available in rule/pagination/processor evaluation). Includes `response.status`, `response.headers`, `response.text`, `response.json` (parsed body), `response.records` (extracted records).
342
342
- `record`: The current data record being processed by a processor (available only within `response.processors`).
343
343
- `queue`: Access queues declared at the top level (e.g., `iterate.over: queue.my_queue`).
344
344
- `null`: Represents a null value (e.g., `coalesce(state.value, null)`).
345
345
346
-
State variables (`state.`) within an endpoint have a defined render order. If `state.b` depends on `state.a` (`state.b: "${state.a + 1}"`), `state.a` will be evaluated first. Circular dependencies are detected and cause an error.
346
+
State variables (`state.`) within an endpoint have a defined render order. If `state.b` depends on `state.a` (`state.b: "{state.a + 1}"`), `state.a` will be evaluated first. Circular dependencies are detected and cause an error.
347
347
348
348
## Endpoints
349
349
@@ -369,26 +369,26 @@ Endpoints define specific API operations. They inherit settings from `defaults`
1. **Run Start:** Sling loads persisted sync values (e.g., `last_sync_ts` from the previous run) into the `sync.` scope.
592
-
2. **State Initialization:** The endpoint's `state` is initialized. Expressions like `${coalesce(sync.last_sync_ts, ...)}` read the persisted value or use a default.
593
-
3. **Requests:** Requests are made using the initialized state (e.g., `updated_since: "${state.start_timestamp}"`).
592
+
2. **State Initialization:** The endpoint's `state` is initialized. Expressions like `{coalesce(sync.last_sync_ts, ...)}` read the persisted value or use a default.
593
+
3. **Requests:** Requests are made using the initialized state (e.g., `updated_since: "{state.start_timestamp}"`).
# jmespath: "data" # Assuming single item response
@@ -702,7 +702,7 @@ endpoints:
702
702
703
703
## Expression Functions
704
704
705
-
You can use the following functions within `${...}` expressions in your API spec. Functions provide capabilities for data manipulation, type casting, date operations, control flow, and more.
705
+
You can use the following functions within `{...}` expressions in your API spec. Functions provide capabilities for data manipulation, type casting, date operations, control flow, and more.
706
706
707
707
**IMPORTANT:** Always use double quotes (`"`) for string literals in expressions, never single quotes (`'`). This is required by the [goval](https://github.com/maja42/goval) expression library that Sling uses.
708
708
@@ -777,7 +777,7 @@ Uses Go's `time` package and `strftime` conventions via [timefmt-go](https://git
777
777
# Format for API parameter (ISO 8601 with timezone)
0 commit comments