-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #308 from WinterFramework/add-url-segment-as-tag
Add add_url_segment_as_tag boolean parameter to generate_openapi function to disable adding url segment as tag in OpenAPI
- Loading branch information
Showing
5 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "winter" | ||
version = "22.1.1" | ||
version = "22.2.0" | ||
homepage = "https://github.com/WinterFramework/winter" | ||
description = "Web Framework with focus on python typing, dataclasses and modular design" | ||
authors = ["Alexander Egorov <[email protected]>"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import winter | ||
from winter.web.routing import get_route | ||
from winter_openapi import generate_openapi | ||
|
||
|
||
def test_add_url_segment_as_tag_false(): | ||
class _TestAPI: | ||
@winter.route_get('resource') | ||
def get_resource(self): # pragma: no cover | ||
pass | ||
|
||
route = get_route(_TestAPI.get_resource) | ||
# Act | ||
result = generate_openapi( | ||
title='title', | ||
version='1.0.0', | ||
description='description', | ||
routes=[route], | ||
add_url_segment_as_tag=False, | ||
) | ||
# Assert | ||
assert result == { | ||
'components': {'parameters': {}, 'responses': {}, 'schemas': {}}, | ||
'info': {'description': 'description', 'title': 'title', 'version': '1.0.0'}, | ||
'openapi': '3.0.3', | ||
'paths': { | ||
'/resource': { | ||
'get': { | ||
'deprecated': False, | ||
'operationId': '_TestAPI.get_resource', | ||
'parameters': [], | ||
'responses': {'200': {'description': ''}}, | ||
'tags': [], | ||
}, | ||
}, | ||
}, | ||
'servers': [{'url': '/'}], | ||
'tags': [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters