File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,9 @@ def get_operation(
7878
7979 # Determine the summary and description based on provided arguments or docstring
8080 if summary is None :
81- doc_description = lines [0 ] if len (lines ) == 0 else "</br >" .join (lines [1 :])
81+ doc_description = lines [0 ] if len (lines ) == 0 else "<br/ >" .join (lines [1 :])
8282 else :
83- doc_description = "</br >" .join (lines )
83+ doc_description = "<br/ >" .join (lines )
8484
8585 summary = summary or doc_summary
8686 description = description or doc_description
Original file line number Diff line number Diff line change @@ -97,6 +97,15 @@ def delete_book(path: BookPath):
9797 return {"code" : 0 , "message" : "ok" }
9898
9999
100+ @api .get ("/book/<int:bid>" )
101+ def get_book (path : BookPath ):
102+ """Get Book
103+ Here is a book
104+ Here's another line in the description
105+ """
106+ return {"title" : "test" , "Author" : "author" }
107+
108+
100109# register api
101110app .register_api (api )
102111
@@ -107,6 +116,8 @@ def test_openapi(client):
107116 assert resp .json == app .api_doc
108117 assert resp .json ["paths" ]["/api/book/{bid}" ]["put" ]["operationId" ] == "update"
109118 assert resp .json ["paths" ]["/api/book/{bid}" ]["delete" ]["operationId" ] == "delete_book"
119+ expected_description = "Here is a book<br/>Here's another line in the description"
120+ assert resp .json ["paths" ]["/api/book/{bid}" ]["get" ]["description" ] == expected_description
110121
111122
112123def test_post (client ):
You can’t perform that action at this time.
0 commit comments