Skip to content

Commit

Permalink
Show for empty request/response body; Change request/response to H4
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevsaddam committed Jan 25, 2022
1 parent 6a069ac commit d8ad8a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions assets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<!--- Table of contents -->
@{{- $numCollections := len .Data.Collections}}@
<!--- If we have only one grouop/collection, then no need for the "ungrouped" heading -->
<!--- If we have only one group/collection, then no need for the "ungrouped" heading -->
@{{- if eq $numCollections 1 }}@
@{{- range $index, $c := .Data.Collections -}}@
@{{- range $i, $item := $c.Items }}@
Expand Down Expand Up @@ -181,7 +181,7 @@ URL: @{{ $item.Request.URL.Raw | trimQueryParams | e }}@
***More example Requests/Responses:***
@{{ range $ir, $resp := $item.Responses }}@
@{{ if $resp.Name }}@
##### @{{ $ir | addOne | roman }}@. Example Request: @{{ $resp.Name }}@
#### @{{ $ir | addOne | roman }}@. Example Request: @{{ $resp.Name }}@

<!--- headers items -->
@{{ if $resp.OriginalRequest.Headers }}@
Expand Down Expand Up @@ -230,7 +230,7 @@ URL: @{{ $item.Request.URL.Raw | trimQueryParams | e }}@
@{{ end }}@

<!--- Body mode -->
@{{ if $resp.OriginalRequest.Body.Mode }}@
@{{ if ne $resp.OriginalRequest.Body.Mode "" }}@
<!--- Raw body data -->
@{{ if eq $resp.OriginalRequest.Body.Mode "raw"}}@
@{{ if $resp.OriginalRequest.Body.Raw }}@
Expand Down Expand Up @@ -273,11 +273,13 @@ URL: @{{ $item.Request.URL.Raw | trimQueryParams | e }}@
@{{ end }}@
<!---End x-urlencoded data -->

@{{ else }}@
***Body: None***
<!--- End Body mode -->
@{{ end }}@

@{{ if $resp.Body }}@
##### @{{ $ir | addOne | roman }}@. Example Response: @{{ $resp.Name }}@
#### @{{ $ir | addOne | roman }}@. Example Response: @{{ $resp.Name }}@
```js
@{{ $resp.Body }}@
```
Expand Down
6 changes: 3 additions & 3 deletions assets_bin/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d8ad8a2

Please sign in to comment.