Skip to content
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

Preserve newlines in docstring description #271

Merged

Conversation

sfisol
Copy link
Contributor

@sfisol sfisol commented Nov 27, 2020

Hello!

This small change adds "\n" at the end of every line in description gathered from docstring. This allows to display markdown when using swagger.

Whereas this works perfectly for me, I'm not sure about other use-cases. For example if in future paperclip will support YAML format then this could potentially break something.

If you have any advice let me know and I'll try to amend this.

@amarjanica
Copy link
Contributor

Hi, I have the same issue. @sfisol I'm curious, why not just write description.join("\n").trim()?

@sfisol sfisol force-pushed the preserve-description-newlines branch from d11096f to 2d2fe1f Compare December 2, 2020 14:09
@sfisol
Copy link
Contributor Author

sfisol commented Dec 2, 2020

You're right @amarjanica, I blindly followed the original pattern :-) Amended. Thanks!

@sfisol sfisol force-pushed the preserve-description-newlines branch from 2d2fe1f to b08e1c0 Compare December 2, 2020 14:10
@wafflespeanut wafflespeanut merged commit 1611743 into paperclip-rs:master Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants