Spring REST Docs is a very nice way to create up-to-date API documentation. It also generates code snippets from your test code, that you can insert into your API documentation. When a user of your API reads your documentation they can easily copy-and-paste the snippets into their terminal and execute it.
Currently it generates snippets using single quotes around string values:
$ curl 'https://some.url.com/teams' -i -X POST -H 'Content-Type: application/json'
-H 'Accept: application/hal+json' -H 'Authorization: Bearer $TOKEN'
-d '{
"description" : "Test Team"
}'
In the above generated curl request $TOKEN
would be an environmental variable, but because of the single quotes the variable substitution would not work. That is why I would like to configure Spring REST Docs somehow to use double quotes around the header's value.
Does anybody know how to do this?