Skip to content

Commit 81eb871

Browse files
authored
docs: rest_api: add tip for escaping curly braces (#2925)
1 parent 5f087a4 commit 81eb871

File tree

1 file changed

+30
-0
lines changed
  • docs/website/docs/dlt-ecosystem/verified-sources/rest_api

1 file changed

+30
-0
lines changed

docs/website/docs/dlt-ecosystem/verified-sources/rest_api/basic.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,36 @@ In the example below we reference the `posts` resource's `id` field in the JSON
772772
}
773773
```
774774

775+
:::tip Escaping curly braces
776+
When your API requires literal curly braces in parameters (e.g., for JSON filters or GraphQL queries), escape them by doubling: `{{` and `}}`.
777+
778+
Example with GraphQL query:
779+
```py
780+
{
781+
"json": {
782+
"query": """
783+
query Artist {{
784+
artist(id: "{resources.artist_list.id}") {{
785+
id
786+
name
787+
}}
788+
}}
789+
"""
790+
}
791+
}
792+
```
793+
794+
Use the same technique for GET request query string parameters:
795+
796+
```py
797+
{
798+
"params": {
799+
"search": "{{'filters': [{{'id': 42}}]}}"
800+
}
801+
}
802+
```
803+
804+
:::
775805

776806
#### Legacy syntax: `resolve` field in parameter configuration
777807

0 commit comments

Comments
 (0)