The automatically generated swagger example for POSTing a new facility returns a 400 error if you copy past and run it in a shell. (In this case bash on macOS 10.14.6)
$ curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Token abc123...' -d '{ \
"country": "US", \
"name": "Azalea", \
"address": "990 Spring Garden Philadelphia" \
}' 'https://localhost:8081/api/facilities/?create=false'
{"detail":"JSON parse error - Expecting property name enclosed in double quotes: line 1 column 3 (char 2)"}
Removing the \ characters resolves the issue. It appears they are being included in the literal JSON string that is submitted.
Overview
The automatically generated swagger example for POSTing a new facility returns a 400 error if you copy past and run it in a shell. (In this case bash on macOS 10.14.6)
Removing the
\
characters resolves the issue. It appears they are being included in the literal JSON string that is submitted.Expected Behavior
The example
curl
command can be pasted into a shell and run successfully without modification.Actual Behavior
A 400 error is returned.
Steps to Reproduce
data
field, setcreate
tofalse
and submit the request.curl
command, paste it into a shell, and run it.