When I look at GraphQL API responses or the input (STDIN) provided in my function logs, I can see that forward slashes (/
) are passed and displayed correctly:
However, when I begin parsing the actual STDIN payload in my Rust-based function, I encounter unnecessarily escaped forward slashes in the text:
{
"id":"gid:\/\/shopify\/ProductVariant\/44519810826520",
"sku":"28800",
"title":"BLACK \/ MEDIUM"
...
}
This seems suboptimal for several reasons:
- It unnecessarily increases the size of the JSON payload, making it more likely to hit the
InputSizeLimitExceededError
on large shopping carts. - It slightly slows down input parsing.
- It requires extra buffering or allocations (rather than simple substring referencing) to store unescaped field values like
"title"
in the example above.
So, I wanted to ask: is this something that could be adjusted on Shopify’s side? The JSON standard does not require escaping forward slashes, so including these extra backslashes appears to be unnecessary.