File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
openapi_python_client/parser Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -59,15 +59,9 @@ def from_data(
59
59
if operation is None :
60
60
continue
61
61
62
- tags = [
63
- utils .PythonIdentifier (value = tag , prefix = "tag" )
64
- for tag in operation .tags or ["default" ]
65
- ]
62
+ tags = [utils .PythonIdentifier (value = tag , prefix = "tag" ) for tag in operation .tags or ["default" ]]
66
63
67
- collections = [
68
- endpoints_by_tag .setdefault (tag , EndpointCollection (tag = tag ))
69
- for tag in tags
70
- ]
64
+ collections = [endpoints_by_tag .setdefault (tag , EndpointCollection (tag = tag )) for tag in tags ]
71
65
72
66
endpoint , schemas , parameters = Endpoint .from_data (
73
67
data = operation ,
@@ -86,9 +80,7 @@ def from_data(
86
80
if not isinstance (endpoint , ParseError ):
87
81
endpoint = Endpoint .sort_parameters (endpoint = endpoint )
88
82
if isinstance (endpoint , ParseError ):
89
- endpoint .header = (
90
- f"WARNING parsing { method .upper ()} { path } within { '/' .join (tags )} . Endpoint will not be generated."
91
- )
83
+ endpoint .header = f"WARNING parsing { method .upper ()} { path } within { '/' .join (tags )} . Endpoint will not be generated."
92
84
for collection in collections :
93
85
collection .parse_errors .append (endpoint )
94
86
continue
Original file line number Diff line number Diff line change @@ -1484,9 +1484,7 @@ def test_from_data_tags_snake_case_sanitizer(self, mocker):
1484
1484
"amf_subscription_info_document" : EndpointCollection (
1485
1485
"amf_subscription_info_document" , endpoints = [endpoint_2 ]
1486
1486
),
1487
- "tag_3" : EndpointCollection (
1488
- "tag_3" , endpoints = [endpoint_2 ]
1489
- ),
1487
+ "tag_3" : EndpointCollection ("tag_3" , endpoints = [endpoint_2 ]),
1490
1488
"tag3_abc" : EndpointCollection ("tag3_abc" , endpoints = [endpoint_3 ]),
1491
1489
},
1492
1490
schemas_3 ,
You can’t perform that action at this time.
0 commit comments