-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break out non-JSON request/response content types as tables (#1756)
* Break out non-JSON request/response content types as tables Currently we display this as a table like "image/png|image/jpeg" and description on a single line, but we're using a table. This breaks the join out to individual rows. * changelog
- Loading branch information
Showing
4 changed files
with
18 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Clearly indicate that each `Content-Type` may have distinct behaviour on non-JSON requests/responses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
{{/* | ||
|
||
Render a table showing content type and description, given: | ||
Render a table showing content types and their descriptions, given | ||
two arrays with equal length: | ||
|
||
* `content_type`: the content type as a string | ||
* `content_types`: the content type strings | ||
|
||
* `description`: the description as a string | ||
* `descriptions`: the description strings | ||
|
||
*/}} | ||
|
||
{{ $content_type := .content_type }} | ||
{{ $description := .description}} | ||
{{ $content_types := .content_types }} | ||
{{ $descriptions := .descriptions}} | ||
|
||
{{ if $content_type }} | ||
{{ if (gt (len $content_types) 0) }} | ||
|
||
<table class="content-type-table"> | ||
<thead> | ||
<th class="col-name">Content-Type</th> | ||
<th class="col-description">Description</th> | ||
</thead> | ||
{{ range $idx, $content_type := $content_types }} | ||
<tr> | ||
<td><code>{{ $content_type }}</code></td> | ||
<td>{{ $description | markdownify -}}</td> | ||
<td>{{ index $descriptions $idx | markdownify -}}</td> | ||
</tr> | ||
{{ end }} | ||
</table> | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters