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(
5959 if operation is None :
6060 continue
6161
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" ]]
6663
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 ]
7165
7266 endpoint , schemas , parameters = Endpoint .from_data (
7367 data = operation ,
@@ -86,9 +80,7 @@ def from_data(
8680 if not isinstance (endpoint , ParseError ):
8781 endpoint = Endpoint .sort_parameters (endpoint = endpoint )
8882 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."
9284 for collection in collections :
9385 collection .parse_errors .append (endpoint )
9486 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):
14841484 "amf_subscription_info_document" : EndpointCollection (
14851485 "amf_subscription_info_document" , endpoints = [endpoint_2 ]
14861486 ),
1487- "tag_3" : EndpointCollection (
1488- "tag_3" , endpoints = [endpoint_2 ]
1489- ),
1487+ "tag_3" : EndpointCollection ("tag_3" , endpoints = [endpoint_2 ]),
14901488 "tag3_abc" : EndpointCollection ("tag3_abc" , endpoints = [endpoint_3 ]),
14911489 },
14921490 schemas_3 ,
You can’t perform that action at this time.
0 commit comments