diff --git a/openapi_python_client/parser/openapi.py b/openapi_python_client/parser/openapi.py index 03a91b031..3cf97c379 100644 --- a/openapi_python_client/parser/openapi.py +++ b/openapi_python_client/parser/openapi.py @@ -94,6 +94,7 @@ class Endpoint: name: str requires_security: bool tag: str + summary: Optional[str] = "" relative_imports: Set[str] = field(default_factory=set) query_parameters: List[Property] = field(default_factory=list) path_parameters: List[Property] = field(default_factory=list) @@ -259,6 +260,7 @@ def from_data( endpoint = Endpoint( path=path, method=method, + summary=utils.remove_string_escapes(data.summary) if data.summary else "", description=utils.remove_string_escapes(data.description) if data.description else "", name=name, requires_security=bool(data.security), diff --git a/tests/test_parser/test_openapi.py b/tests/test_parser/test_openapi.py index 1b43041a4..9ee52dd69 100644 --- a/tests/test_parser/test_openapi.py +++ b/tests/test_parser/test_openapi.py @@ -631,6 +631,7 @@ def test_from_data_standard(self, mocker): path=path, method=method, description=data.description, + summary="", name=data.operationId, requires_security=True, tag="default", @@ -677,6 +678,7 @@ def test_from_data_no_operation_id(self, mocker): path=path, method=method, description=data.description, + summary="", name="get_path_with_param", requires_security=True, tag="default", @@ -724,6 +726,7 @@ def test_from_data_no_security(self, mocker): path=path, method=method, description=data.description, + summary="", name=data.operationId, requires_security=False, tag="a",