-
Notifications
You must be signed in to change notification settings - Fork 472
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
Set endpoint description in Markdown #560
Conversation
6f7f76b
to
a41387c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for sorting out the description vs. summary stuff
and revert the other two changes, there a Markdown adapter is given, this implies, given Markdown should be transformed into HTML
@@ -104,7 +106,7 @@ def app | |||
specify do | |||
expect(subject['paths']['/use_gfm_detail']['get']).to include('description') | |||
expect(subject['paths']['/use_gfm_detail']['get']['description']).to eql( | |||
"<h1 id=\"this-returns-something\">This returns something</h1>\n<p># Burgers in Heaven</p>\n\n<blockquote>\n <p>A burger doesn’t come for free</p>\n</blockquote>\n\n<p>If you want to reserve a burger in heaven, you have to do<br />\nsome crazy stuff on earth.</p>\n\n<pre><code>def do_good\nputs 'help people'\nend\n</code></pre>\n\n<ul>\n <li><em>Will go to Heaven:</em> Probably</li>\n <li><em>Will go to Hell:</em> Probably not</li>\n</ul>" | |||
"> A burger doesn't come for free\n\nIf you want to reserve a burger in heaven, you have to do\nsome crazy stuff on earth.\n\n```\ndef do_good\nputs 'help people'\nend\n```\n\n* _Will go to Heaven:_ Probably\n* _Will go to Hell:_ Probably not\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert it, cause a MArkdown formmater is set (https://github.com/Mapotempo/grape-swagger/blob/a41387c14f667bd88fd63addf04f949e1d8e7673/spec/swagger_v2/api_swagger_v2_detail_spec.rb#L92), means it should be transformed to HTML
@@ -142,7 +145,7 @@ def app | |||
specify do | |||
expect(subject['paths']['/use_gfm_rc_detail']['get']).to include('description') | |||
expect(subject['paths']['/use_gfm_rc_detail']['get']['description']).to eql( | |||
"<h1>This returns something</h1>\n\n<p># Burgers in Heaven</p>\n\n<blockquote>\n<p>A burger doesn't come for free</p>\n</blockquote>\n\n<p>If you want to reserve a burger in heaven, you have to do\nsome crazy stuff on earth.</p>\n<pre class=\"highlight plaintext\"><code>def do_good\nputs 'help people'\nend\n</code></pre>\n<ul>\n<li><em>Will go to Heaven:</em> Probably</li>\n<li><em>Will go to Hell:</em> Probably not</li>\n</ul>" | |||
"> A burger doesn't come for free\n\nIf you want to reserve a burger in heaven, you have to do\nsome crazy stuff on earth.\n\n```\ndef do_good\nputs 'help people'\nend\n```\n\n* _Will go to Heaven:_ Probably\n* _Will go to Hell:_ Probably not\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a41387c
to
1ff8431
Compare
I done what you ask.
|
bdcc25c
to
b8870c3
Compare
thanks @frodrigo for adaptions … actual, the summary can be prtovided as plain text, as md, and as html rendered md, if the specific option was set yeap, it seems that the spec accept plain text and markdown, but not HTML, as you said, what did you think, should the markdown render stuff moved out? |
I think for swagger 2 spec the HTML is no more required. And moreover tools using the spec expect markdown and convert it (e.g. swgger ui or swagger code gen deface the output, because they recive HTML and trait it as markdown). |
would you remove all the markdown stuff then in this PR, or did you prefer to do it in a separate one? |
@frodrigo … want to mörge it, the moving of Markdown out could be done in a separate PR, ok? |
Set endpoint description in Markdown #559
Map clearly Grape desc/detail to Swagger summary/description