Symbols escaping
To use reserved symbols in scenario or json files, you need to escape them.
Here is the list of symbols you need to escape:
- "
- .
- *
- ^
- $
- ?
- +
- -
- {}
- []
The way of symbol escaping depends on where you need to escape them. If you need to escape symbol in JSON file or in scenario, you need to follow the rules of escaping for specific format you're using (JSON, XML and so on).
So, here are some examples of symbol escaping for JSON and XML formats:
{
"query": "{ getBookByTitle(title: \"A Man Called Ove\") { id number } }"
}
<graphql comment="GraphQL query with invalid operationName for Get method" alias="spaceX">
<get endpoint="/graphql">
<response code="400" file="expected_6.json"/>
<param name="query"
data="query GetLaunchesByMissionName($missionName: String!) { launches(find:{
mission_name: $missionName }) { mission_name launch_date_local launch_success rocket {rocket_name rocket_type}}}"/>
<param name="variables" data="{ "missionName": "CRS-16" }"/>
<param name="operationName" data="GetLaunches"/>
</get>
</graphql>