Skip to content

Commit 890c37f

Browse files
jmartenswing328
andauthored
fix: display of markdown in notes section (#20534)
* fix: display of markdown in notes section * update samples * skip blank lines --------- Co-authored-by: William Cheng <wing328hk@gmail.com>
1 parent c2884b7 commit 890c37f

12 files changed

Lines changed: 116 additions & 60 deletions

File tree

modules/openapi-generator/src/main/resources/python-pydantic-v1/api_doc.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Method | HTTP request | Description
1313
# **{{{operationId}}}**
1414
> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
1515

16-
{{{summary}}}{{#notes}}
16+
{{{summary}}}
1717

18-
{{{.}}}{{/notes}}
18+
{{#unescapedNotes}}{{{.}}}{{/unescapedNotes}}
1919

2020
### Example
2121

modules/openapi-generator/src/main/resources/python/api_doc.mustache

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ Method | HTTP request | Description
1313
# **{{{operationId}}}**
1414
> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
1515

16-
{{{summary}}}{{#notes}}
16+
{{#summary}}
17+
{{{summary}}}
1718

18-
{{{.}}}{{/notes}}
19+
{{/summary}}
20+
{{#unescapedNotes}}
21+
{{{.}}}
1922

23+
{{/unescapedNotes}}
2024
### Example
2125

2226
{{#hasAuthMethods}}

samples/openapi3/client/petstore/python-aiohttp/docs/DefaultApi.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Method | HTTP request | Description
1010
# **foo_get**
1111
> FooGetDefaultResponse foo_get()
1212
13-
14-
1513
### Example
1614

1715

samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ void (empty response body)
370370
# **fake_outer_boolean_serialize**
371371
> bool fake_outer_boolean_serialize(body=body)
372372
373-
374-
375373
Test serialization of outer boolean types
376374

377375
### Example
@@ -436,8 +434,6 @@ No authorization required
436434
# **fake_outer_composite_serialize**
437435
> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
438436
439-
440-
441437
Test serialization of object with outer number type
442438

443439
### Example
@@ -503,8 +499,6 @@ No authorization required
503499
# **fake_outer_number_serialize**
504500
> float fake_outer_number_serialize(body=body)
505501
506-
507-
508502
Test serialization of outer number types
509503

510504
### Example
@@ -569,8 +563,6 @@ No authorization required
569563
# **fake_outer_string_serialize**
570564
> str fake_outer_string_serialize(body=body)
571565
572-
573-
574566
Test serialization of outer string types
575567

576568
### Example
@@ -635,8 +627,6 @@ No authorization required
635627
# **fake_property_enum_integer_serialize**
636628
> OuterObjectWithEnumProperty fake_property_enum_integer_serialize(outer_object_with_enum_property, param=param)
637629
638-
639-
640630
Test serialization of enum (int) properties with examples
641631

642632
### Example
@@ -1445,8 +1435,6 @@ No authorization required
14451435
# **test_body_with_binary**
14461436
> test_body_with_binary(body)
14471437
1448-
1449-
14501438
For this test, the body has to be a binary file.
14511439

14521440
### Example
@@ -1509,8 +1497,6 @@ No authorization required
15091497
# **test_body_with_file_schema**
15101498
> test_body_with_file_schema(file_schema_test_class)
15111499
1512-
1513-
15141500
For this test, the body for this request must reference a schema named `File`.
15151501

15161502
### Example
@@ -1574,8 +1560,6 @@ No authorization required
15741560
# **test_body_with_query_params**
15751561
> test_body_with_query_params(query, user)
15761562
1577-
1578-
15791563
### Example
15801564

15811565

@@ -1641,7 +1625,7 @@ No authorization required
16411625
16421626
To test \"client\" model
16431627

1644-
To test \"client\" model
1628+
To test "client" model
16451629

16461630
### Example
16471631

@@ -1707,8 +1691,6 @@ No authorization required
17071691
# **test_date_time_query_parameter**
17081692
> test_date_time_query_parameter(date_time_query, str_query)
17091693
1710-
1711-
17121694
### Example
17131695

17141696

@@ -1835,7 +1817,11 @@ No authorization required
18351817
18361818
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
18371819

1838-
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
1820+
Fake endpoint for testing various parameters
1821+
假端點
1822+
偽のエンドポイント
1823+
가짜 엔드 포인트
1824+
18391825

18401826
### Example
18411827

@@ -2282,8 +2268,6 @@ No authorization required
22822268
# **test_object_for_multipart_requests**
22832269
> test_object_for_multipart_requests(marker)
22842270
2285-
2286-
22872271
### Example
22882272

22892273

@@ -2345,8 +2329,6 @@ No authorization required
23452329
# **test_query_parameter_collection_format**
23462330
> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
23472331
2348-
2349-
23502332
To test the collection format in query parameters
23512333

23522334
### Example

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DefaultApi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Method | HTTP request | Description
1212
1313

1414

15+
16+
1517
### Example
1618

1719
```python

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FakeApi.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Method | HTTP request | Description
4848
4949
test any type request body
5050

51+
52+
5153
### Example
5254

5355
```python
@@ -110,6 +112,8 @@ No authorization required
110112
111113
test enum reference query parameter
112114

115+
116+
113117
### Example
114118

115119
```python
@@ -173,6 +177,8 @@ No authorization required
173177
174178
Health check endpoint
175179

180+
181+
176182
### Example
177183

178184
```python
@@ -234,6 +240,8 @@ No authorization required
234240
235241
test http signature authentication
236242

243+
244+
237245
### Example
238246

239247
```python
@@ -698,6 +706,8 @@ No authorization required
698706
699707
test ref to enum string
700708

709+
710+
701711
### Example
702712

703713
```python
@@ -759,6 +769,8 @@ No authorization required
759769
760770
test returning boolean
761771

772+
773+
762774
### Example
763775

764776
```python
@@ -819,6 +831,8 @@ No authorization required
819831
820832
test byte like json
821833

834+
835+
822836
### Example
823837

824838
```python
@@ -879,6 +893,8 @@ No authorization required
879893
880894
test returning enum
881895

896+
897+
882898
### Example
883899

884900
```python
@@ -939,6 +955,8 @@ No authorization required
939955
940956
test enum like json
941957

958+
959+
942960
### Example
943961

944962
```python
@@ -999,6 +1017,8 @@ No authorization required
9991017
10001018
test returning float
10011019

1020+
1021+
10021022
### Example
10031023

10041024
```python
@@ -1059,6 +1079,8 @@ No authorization required
10591079
10601080
test returning int
10611081

1082+
1083+
10621084
### Example
10631085

10641086
```python
@@ -1119,6 +1141,8 @@ No authorization required
11191141
11201142
test returning list of objects
11211143

1144+
1145+
11221146
### Example
11231147

11241148
```python
@@ -1180,6 +1204,8 @@ No authorization required
11801204
11811205
test str like json
11821206

1207+
1208+
11831209
### Example
11841210

11851211
```python
@@ -1240,6 +1266,8 @@ No authorization required
12401266
12411267
test returning string
12421268

1269+
1270+
12431271
### Example
12441272

12451273
```python
@@ -1300,6 +1328,8 @@ No authorization required
13001328
13011329
test uuid example
13021330

1331+
1332+
13031333
### Example
13041334

13051335
```python
@@ -1553,6 +1583,8 @@ No authorization required
15531583
15541584

15551585

1586+
1587+
15561588
### Example
15571589

15581590
```python
@@ -1617,7 +1649,7 @@ No authorization required
16171649
16181650
To test \"client\" model
16191651

1620-
To test \"client\" model
1652+
To test "client" model
16211653

16221654
### Example
16231655

@@ -1684,6 +1716,8 @@ No authorization required
16841716
16851717

16861718

1719+
1720+
16871721
### Example
16881722

16891723
```python
@@ -1808,7 +1842,11 @@ No authorization required
18081842
18091843
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
18101844

1811-
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
1845+
Fake endpoint for testing various parameters
1846+
假端點
1847+
偽のエンドポイント
1848+
가짜 엔드 포인트
1849+
18121850

18131851
### Example
18141852

@@ -1912,6 +1950,8 @@ void (empty response body)
19121950
19131951
test error responses with model
19141952

1953+
1954+
19151955
### Example
19161956

19171957
```python
@@ -2251,6 +2291,8 @@ No authorization required
22512291
22522292

22532293

2294+
2295+
22542296
### Example
22552297

22562298
```python

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ImportTestDatetimeApi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Method | HTTP request | Description
1212
1313
test date time
1414

15+
16+
1517
### Example
1618

1719
```python

samples/openapi3/client/petstore/python-pydantic-v1/docs/DefaultApi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Method | HTTP request | Description
1212
1313

1414

15+
16+
1517
### Example
1618

1719
```python

0 commit comments

Comments
 (0)