Skip to content

Commit

Permalink
Demonstrate a difference in docstring treatment (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat authored May 20, 2020
1 parent 54a0c81 commit 152a197
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
17 changes: 17 additions & 0 deletions example/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,23 @@ def get(self, request):
Get information about the Hedgehog API.
Returns a object with keys and values describing the API.
Args:
request: a Request.
"""
raise EndpointNotImplemented()

def put(self, request):
"""
Not really an endpoint at all, but has no @schema decorator.
This is to show the difference in treatment. This is a second
paragraph which will be included in the docs.
Args:
request: a Request.
"""
raise EndpointNotImplemented()

Expand Down
20 changes: 17 additions & 3 deletions tests/expected_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
},
"/hedgehog/v0/info": {
"get": {
"description": "Returns a object with keys and values describing the API.",
"description": "Returns a object with keys and values describing the API.\n\nArgs:\n request: a Request.",
"operationId": "hedgehog_v0_info_list",
"parameters": [],
"responses": {
Expand All @@ -244,7 +244,21 @@
"hedgehog"
]
},
"parameters": []
"parameters": [],
"put": {
"description": "This is to show the difference in treatment. This is a second\nparagraph which will be included in the docs.",
"operationId": "hedgehog_v0_info_update",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"summary": "Not really an endpoint at all, but has no @schema decorator.",
"tags": [
"hedgehog"
]
}
}
},
"produces": [
Expand All @@ -264,4 +278,4 @@
}
},
"swagger": "2.0"
}
}

0 comments on commit 152a197

Please sign in to comment.