Skip to content

Commit da29bc6

Browse files
committed
fix code generation script
1 parent 1c635dd commit da29bc6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

generate_from_openapi.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _init_endpoint(endpoint: str):
212212
tuple: (full_folder_path, file_name)
213213
"""
214214
full_folder_path = root_folder
215-
full_import_path = []
215+
full_import_path: list[str] = []
216216
folder_path_parts, file_name = _gen_folder_and_file_paths(endpoint)
217217

218218
# Create nested folder structure
@@ -230,7 +230,7 @@ def _init_endpoint(endpoint: str):
230230
# Generate functions
231231

232232

233-
def _gen_code_params_default_value(param: object):
233+
def _gen_code_params_default_value(param: dict):
234234
"""
235235
Generate default value code for function parameters.
236236
@@ -811,7 +811,7 @@ def {operation_id}(mist_session:_APISession{code_path_params}, body:dict) -> _AP
811811
# PARAMS - Parameter processing functions
812812

813813

814-
def _process_path_params(endpoint_params: object):
814+
def _process_path_params(endpoint_params: dict):
815815
"""
816816
Process path parameters from OpenAPI endpoint definition.
817817
@@ -837,7 +837,7 @@ def _process_path_params(endpoint_params: object):
837837
return params
838838

839839

840-
def _process_query_params(endpoint_params: object):
840+
def _process_query_params(endpoint_params: dict):
841841
"""
842842
Process query parameters from OpenAPI endpoint definition.
843843
@@ -863,7 +863,7 @@ def _process_query_params(endpoint_params: object):
863863
return params
864864

865865

866-
def _process_body_params(request_body: object, content_type: str = "application/json"):
866+
def _process_body_params(request_body: dict, content_type: str = "application/json"):
867867
"""
868868
Process request body parameters from OpenAPI definition.
869869
@@ -888,7 +888,7 @@ def _process_body_params(request_body: object, content_type: str = "application/
888888

889889

890890
def _process_endpoint(
891-
endpoint_data: object, endpoint_path: str, folder_path: str, file_name: str
891+
endpoint_data: dict, endpoint_path: str, folder_path: str, file_name: str
892892
):
893893
"""
894894
Process a single API endpoint and generate corresponding functions.
@@ -1006,7 +1006,7 @@ def _process_endpoint(
10061006
return count
10071007

10081008

1009-
def _is_totaly_deprecated(endpoint_data: object) -> bool:
1009+
def _is_totaly_deprecated(endpoint_data: dict) -> bool:
10101010
"""
10111011
Check if an endpoint is completely deprecated (all HTTP methods are deprecated).
10121012

tests/unit/test_api_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_default_initialisation(self, isolated_session) -> None:
2525
assert isolated_session._cloud_uri == ""
2626
assert isolated_session.email is None
2727
assert isolated_session._password is None
28-
assert isolated_session._apitoken is None
28+
assert isolated_session._apitoken == []
2929
assert not isolated_session._authenticated
3030
assert isolated_session._console_log_level == 50 # Set in fixture
3131
assert isolated_session._logging_log_level == 10

0 commit comments

Comments
 (0)