Closed kylef closed 5 years ago
Given the following API Blueprint, with an MSON property href":
href"
# API Name ## GET / + Response 200 (application/json) + Attributes + `href"`
The final parse result contains a JSON String:
"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"href\"\": {\n \"type\": \"string\"\n }\n }\n}"
Note the " is not correctly escaped (\"href\"\") it should be escaped an extra time inside the key quotes.
"
\"href\"\"
$ ./bin/drafter dd.apib -f json | jq .content[0].content[0].content[0].content[0].content[1].content[2].content "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"href\"\": {\n \"type\": \"string\"\n }\n }\n}" $ ./bin/drafter dd.apib -f json | jq .content[0].content[0].content[0].content[0].content[1].content[2].content -r { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "href"": { "type": "string" } } } $ ./bin/drafter dd.apib -f json | jq .content[0].content[0].content[0].content[0].content[1].content[2].content -r | jq parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 6, column 7
Given the following API Blueprint, with an MSON property
href"
:The final parse result contains a JSON String:
Note the
"
is not correctly escaped (\"href\"\"
) it should be escaped an extra time inside the key quotes.