Skip to content

Commit fda4c0e

Browse files
Fix request body and response tabs merging into one tab group (#76)
pymdownx.tabbed treats consecutive === blocks separated by only whitespace as a single tab group. After issue #35, the content-type tabs in request-body and the response-code tabs in request-responses were both at column 0 with only blank lines between them, causing them to merge into one tab group. Fix: add a <p class="responses-title"> heading before the responses tab loop in request-responses.html. This provides a non-tab line that breaks the tab group chain, keeping request body tabs and response tabs separate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0054857 commit fda4c0e

File tree

5 files changed

+99
-25
lines changed

5 files changed

+99
-25
lines changed

openapidocs/mk/v3/views_mkdocs/partial/request-responses.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<p class="responses-title"><strong>{{texts.responses}}</strong></p>
2+
13
{% for code, definition in operation.responses.items() %}
24
=== "{% if code == "default" %}{{texts.other_responses}}{% else %}{{code}}{% with phrase = get_http_status_phrase(code) %}{% if phrase %} {{ phrase }}{% endif %}{% endwith %}{% endif %}"
35
{%- if is_reference(definition) -%}

tests/res/example1-output.md

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ Initializes a file upload operation.
121121
}
122122
```
123123

124+
<p class="responses-title"><strong>Responses</strong></p>
125+
124126

125127
=== "200 OK"
126128

@@ -214,7 +216,9 @@ Gets the list of categories supported by the system.
214216
<td>Access token issued by Azure Active Directory.</td>
215217
</tr>
216218
</tbody>
217-
</table>
219+
</table><p class="responses-title"><strong>Responses</strong></p>
220+
221+
218222
=== "200 OK"
219223

220224
=== "application/json"
@@ -345,7 +349,9 @@ Gets a list of countries of the World with English dislay names and ISO country
345349
<td>Access token issued by Azure Active Directory.</td>
346350
</tr>
347351
</tbody>
348-
</table>
352+
</table><p class="responses-title"><strong>Responses</strong></p>
353+
354+
349355
=== "200 OK"
350356

351357
=== "application/json"
@@ -405,7 +411,9 @@ Gets a list of countries supported by the system, with English dislay names and
405411
<td>Access token issued by Azure Active Directory.</td>
406412
</tr>
407413
</tbody>
408-
</table>
414+
</table><p class="responses-title"><strong>Responses</strong></p>
415+
416+
409417
=== "200 OK"
410418

411419
=== "application/json"
@@ -525,7 +533,9 @@ Gets a paginated set of downloads records.
525533
<td></td>
526534
</tr>
527535
</tbody>
528-
</table>
536+
</table><p class="responses-title"><strong>Responses</strong></p>
537+
538+
529539
=== "200 OK"
530540

531541
=== "application/json"
@@ -678,7 +688,9 @@ API health check
678688
<td>Access token issued by Azure Active Directory.</td>
679689
</tr>
680690
</tbody>
681-
</table>
691+
</table><p class="responses-title"><strong>Responses</strong></p>
692+
693+
682694
=== "200 OK"
683695

684696
=== "application/json"
@@ -751,7 +763,9 @@ API health check
751763
<td>Access token issued by Azure Active Directory.</td>
752764
</tr>
753765
</tbody>
754-
</table>
766+
</table><p class="responses-title"><strong>Responses</strong></p>
767+
768+
755769
=== "200 OK"
756770

757771
=== "application/json"
@@ -845,7 +859,9 @@ Returns information about the API itself.
845859
<td>Access token issued by Azure Active Directory.</td>
846860
</tr>
847861
</tbody>
848-
</table>
862+
</table><p class="responses-title"><strong>Responses</strong></p>
863+
864+
849865
=== "200 OK"
850866

851867
=== "application/json"
@@ -927,7 +943,9 @@ Returns details about a release by id.
927943
<td></td>
928944
</tr>
929945
</tbody>
930-
</table>
946+
</table><p class="responses-title"><strong>Responses</strong></p>
947+
948+
931949
=== "200 OK"
932950

933951
=== "application/json"
@@ -1147,7 +1165,9 @@ Deletes a release by id.
11471165
<td></td>
11481166
</tr>
11491167
</tbody>
1150-
</table>
1168+
</table><p class="responses-title"><strong>Responses</strong></p>
1169+
1170+
11511171
=== "200 OK"
11521172

11531173
<hr class="operation-separator" />
@@ -1250,6 +1270,8 @@ Deletes a release by id.
12501270
}
12511271
```
12521272

1273+
<p class="responses-title"><strong>Responses</strong></p>
1274+
12531275

12541276
=== "200 OK"
12551277

@@ -1519,7 +1541,9 @@ Deletes a release by id.
15191541
<td></td>
15201542
</tr>
15211543
</tbody>
1522-
</table>
1544+
</table><p class="responses-title"><strong>Responses</strong></p>
1545+
1546+
15231547
=== "200 OK"
15241548

15251549
=== "application/json"
@@ -1711,6 +1735,8 @@ Deletes a release by id.
17111735
}
17121736
```
17131737

1738+
<p class="responses-title"><strong>Responses</strong></p>
1739+
17141740

17151741
=== "200 OK"
17161742

@@ -1771,7 +1797,9 @@ Deletes a release by id.
17711797
<td>Access token issued by Azure Active Directory.</td>
17721798
</tr>
17731799
</tbody>
1774-
</table>
1800+
</table><p class="responses-title"><strong>Responses</strong></p>
1801+
1802+
17751803
=== "200 OK"
17761804

17771805
=== "application/json"
@@ -1834,7 +1862,9 @@ Deletes a release by id.
18341862
<td>Access token issued by Azure Active Directory.</td>
18351863
</tr>
18361864
</tbody>
1837-
</table>
1865+
</table><p class="responses-title"><strong>Responses</strong></p>
1866+
1867+
18381868
=== "200 OK"
18391869

18401870
=== "application/json"
@@ -1905,7 +1935,9 @@ Deletes a release by id.
19051935
<td></td>
19061936
</tr>
19071937
</tbody>
1908-
</table>
1938+
</table><p class="responses-title"><strong>Responses</strong></p>
1939+
1940+
19091941
=== "200 OK"
19101942

19111943
=== "application/json"
@@ -2044,7 +2076,9 @@ Deletes a release by id.
20442076
<td></td>
20452077
</tr>
20462078
</tbody>
2047-
</table>
2079+
</table><p class="responses-title"><strong>Responses</strong></p>
2080+
2081+
20482082
=== "200 OK"
20492083

20502084
=== "application/json"
@@ -2120,7 +2154,9 @@ Deletes a release by id.
21202154
<td></td>
21212155
</tr>
21222156
</tbody>
2123-
</table>
2157+
</table><p class="responses-title"><strong>Responses</strong></p>
2158+
2159+
21242160
=== "200 OK"
21252161

21262162
=== "application/json"
@@ -2221,6 +2257,8 @@ Deletes a release by id.
22212257
}
22222258
```
22232259

2260+
<p class="responses-title"><strong>Responses</strong></p>
2261+
22242262

22252263
=== "200 OK"
22262264

@@ -2471,6 +2509,8 @@ Deletes a release by id.
24712509
}
24722510
```
24732511

2512+
<p class="responses-title"><strong>Responses</strong></p>
2513+
24742514

24752515
=== "200 OK"
24762516

@@ -2731,6 +2771,8 @@ Deletes a release by id.
27312771
}
27322772
```
27332773

2774+
<p class="responses-title"><strong>Responses</strong></p>
2775+
27342776

27352777
=== "200 OK"
27362778

@@ -2980,6 +3022,8 @@ Deletes a release by id.
29803022
}
29813023
```
29823024

3025+
<p class="responses-title"><strong>Responses</strong></p>
3026+
29833027

29843028
=== "200 OK"
29853029

@@ -3201,7 +3245,9 @@ Deletes a release by id.
32013245
<td></td>
32023246
</tr>
32033247
</tbody>
3204-
</table>
3248+
</table><p class="responses-title"><strong>Responses</strong></p>
3249+
3250+
32053251
=== "200 OK"
32063252

32073253
=== "application/json"
@@ -3457,6 +3503,8 @@ Deletes a release by id.
34573503
}
34583504
```
34593505

3506+
<p class="responses-title"><strong>Responses</strong></p>
3507+
34603508

34613509
=== "200 OK"
34623510

tests/res/example2-output.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ List all pets
7878
<td>How many items to return at one time (max 100)</td>
7979
</tr>
8080
</tbody>
81-
</table>
81+
</table><p class="responses-title"><strong>Responses</strong></p>
82+
83+
8284
=== "200 OK"
8385

8486
=== "application/json"
@@ -190,7 +192,9 @@ Create a pet
190192
<td>Basic authentication</td>
191193
</tr>
192194
</tbody>
193-
</table>
195+
</table><p class="responses-title"><strong>Responses</strong></p>
196+
197+
194198
=== "201 Created"
195199
=== "Other responses"
196200

@@ -274,7 +278,9 @@ Info for a specific pet
274278
<td>The id of the pet to retrieve</td>
275279
</tr>
276280
</tbody>
277-
</table>
281+
</table><p class="responses-title"><strong>Responses</strong></p>
282+
283+
278284
=== "200 OK"
279285

280286
=== "application/json"
@@ -420,6 +426,8 @@ Info for a specific pet
420426
}
421427
```
422428

429+
<p class="responses-title"><strong>Responses</strong></p>
430+
423431

424432
=== "200 OK"
425433

tests/res/example3-output.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ List all pets
6262
<td>How many items to return at one time (max 100)</td>
6363
</tr>
6464
</tbody>
65-
</table>
65+
</table><p class="responses-title"><strong>Responses</strong></p>
66+
67+
6668
=== "200 OK"
6769

6870
=== "application/json"
@@ -141,7 +143,9 @@ List all pets
141143
<hr class="operation-separator" />
142144

143145
### <span class="http-post">POST</span> /pets
144-
Create a pet
146+
Create a pet<p class="responses-title"><strong>Responses</strong></p>
147+
148+
145149
=== "201 Created"
146150
=== "Other responses"
147151

@@ -209,7 +213,9 @@ Info for a specific pet
209213
<td>The id of the pet to retrieve</td>
210214
</tr>
211215
</tbody>
212-
</table>
216+
</table><p class="responses-title"><strong>Responses</strong></p>
217+
218+
213219
=== "200 OK"
214220

215221
=== "application/json"
@@ -322,6 +328,8 @@ Info for a specific pet
322328
}
323329
```
324330

331+
<p class="responses-title"><strong>Responses</strong></p>
332+
325333

326334
=== "200 OK"
327335

tests/res/example4-split-output.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ Invite a user
109109
}
110110
```
111111

112+
<p class="responses-title"><strong>Responses</strong></p>
113+
112114

113115
=== "200 OK"
114116

@@ -201,7 +203,9 @@ Retrieve all users
201203
<td>The maximum number of items to return.</td>
202204
</tr>
203205
</tbody>
204-
</table>
206+
</table><p class="responses-title"><strong>Responses</strong></p>
207+
208+
205209
=== "200 OK"
206210

207211
=== "application/json"
@@ -300,7 +304,9 @@ Get user by ID/Email
300304
<td>The ID or email of the user.</td>
301305
</tr>
302306
</tbody>
303-
</table>
307+
</table><p class="responses-title"><strong>Responses</strong></p>
308+
309+
304310
=== "200 OK"
305311
<div class="common-response"><p>Refer to the common response description: <a href="#userinformation" class="ref-link">UserInformation</a>.</p></div>
306312
=== "401 Unauthorized"
@@ -354,7 +360,9 @@ Delete user by ID/Email
354360
<td>ID of the user to transfer workflows and credentials to. Must not be equal to the to-be-deleted user.</td>
355361
</tr>
356362
</tbody>
357-
</table>
363+
</table><p class="responses-title"><strong>Responses</strong></p>
364+
365+
358366
=== "200 OK"
359367
<div class="common-response"><p>Refer to the common response description: <a href="#userinformation" class="ref-link">UserInformation</a>.</p></div>
360368
=== "401 Unauthorized"

0 commit comments

Comments
 (0)