-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trailing newline fails text/plain #67
Comments
Thank you for the report, but this is still a Snowcrash issue as you mentioned. |
Because it can't be solved in snowcrash, what do you think about command line option for dredd |
Related to #343. |
This is still an issue. Workaround can be done by hooks. |
This is specific to API Blueprint and quite dependent on how Drafter (the API Blueprint parser) handles the situation. The nature of the format makes it difficult for the parser to decide whether the body payload ends with a newline or not. Hence the parser always adds the newline. In JSON, this is not a problem, but in plain text formats, this is a serious issue. Dredd could implement a strategy around this, but I'm not sure what would be the best way to approach this. In most cases, the newline is unwanted, but what if user expects the newline? Dredd cannot just always remove the newline. |
My proposal for solution would be to implement following algorithm. If the list items below are all true:
...then assume those response bodies are equal. As this is specific to one API description format, it should be implemented in Dredd, not in Gavel.js. |
…-swagger Update Fury adapter for Swagger
@honzajavorek is this a general expectations toward gavel to ignore newlines? If so, I suggest it solved on the Gavel's side. If it's a workaround specific for APIB, then it diverges the behavior between the default behavior (gavel validating body as-is), and Dredd swallowing newlines for APIB only. If the newlines are produced by mistake by parser, it's a parser issue as you've already referred to:
Can we get some more insights why is this serious and cannot be tackled on the parser's side? |
I'd suggest sth like (pseudocode):
|
Is there a solution for
apiaryio/snowcrash#56
?
due to the inserted \n, comparing text/plain will always fail the dredd test.
Here's my transaction in the after hook
and my markdown is simply
The text was updated successfully, but these errors were encountered: