You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.
I can't find out how to describe / express response payload body in the API Blueprint format without trailing newline in the result AST. I'm trying both fenced and normal syntax for the code block without any success. I need to express response body precisely because I'm testing the backend API with Dredd and this issue brakes my tests.
OK.
warning: (3) message-body content is expected to be a pre-formatted code block, separate it by an empty line and indent every of its line by at least 4 spaces or 1 tab :61:6
_version: 1.0
metadata:
name: My API
description:
resourceGroups:
- name:
description:
resources:
- name: Fish
description:
uriTemplate: /fish
model:
parameters:
headers:
actions:
- name: Catch
description:
method: GET
parameters:
headers:
examples:
- name:
description:
requests:
responses:
- name: 404
description:
headers:
body: "Whip!\n"
schema:
- name: Release
description:
method: DELETE
parameters:
headers:
examples:
- name:
description:
requests:
responses:
- name: 404
description:
headers:
body: "Blam...\n"
schema:
The text was updated successfully, but these errors were encountered:
I am afraid the only option at the moment is to eat one the trailing new line manually (as Apiary does). This is the limitation caused by the Makrdown syntax for pre formatted code block.
Snow Crash could remove one trailing new line but then the problem would be opposite – what if you need your message-body with a new line?
I think Snowcrash should remove last trailing newline added by the sundown parser and to have explicitly add trailing new-line if you want it in the message-body. It's the same like text editors does it.
As per our discussion with @netmilk We have agreed that there would be no good solution to address this on the parser-side. I will close this issue with pointing to the subject of it as a parser behavior
Assets and trailing new lines
According to the original markdown specification pre-formatted blocks are recognized produced by indenting every line of the block by at least 4 spaces or 1 tab.
However from a markdown perspective this always results in a string with a trailing new line – code block\n. For a Snow Crash user (tooling) it is safe to assume that there is always at least one trailing new line in an asset being parsed.
However from the user input Snow Crash can't make assumptions whether this newline is intentional or given by the Markdown syntax requirements. For these reasons Snow Crash leaves up to the tooling to consider (and strip) whether the newline should be stripped.
Note: The intent could be expressed in a future using external assets.
Hi,
I can't find out how to describe / express response payload body in the API Blueprint format without trailing newline in the result AST. I'm trying both fenced and normal syntax for the code block without any success. I need to express response body precisely because I'm testing the backend API with Dredd and this issue brakes my tests.
My blueprint is here and the
snowcrash
output is:The text was updated successfully, but these errors were encountered: