bundesAPI / bundesAPI/interpol-api

Example out of doc folder fails

Đang mở
#6 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
16
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Installed deutschland 0.3.0 and executed the example from the doc folder:
```python
import time
from deutschland import interpol
from deutschland.interpol.api import default_api
from deutschland.interpol.model.red_notices import RedNotices
from pprint import pprint
# Defining the host is optional and defaults to https://ws-public.interpol.int
# See configuration.py for a list of all supported configuration parameters.
configuration = interpol.Configuration(
host = "https://ws-public.interpol.int"
)

# Enter a context with an instance of the API client
with interpol.ApiClient() as api_client:
# Create an instance of the API class
api_instance = default_api.DefaultApi(api_client)
forename = "MAX" # str | First name (optional)
name = "Mustermann" # str | Last name (optional)
nationality = "DE" # str | Two digit country code (optional)
age_max = 120 # int | maximum age (optional)
age_min = 18 # int | minimum age (optional)
free_text = "" # str | Free text query (optional)
sex_id = "F" # str | Free text query (optional)
arrest_warrant_country_id = "DE" # str | Two digit country code (optional)
page = 1 # int | pagination - starts with 1 (optional)
result_per_page = 200 # int | resultPerPage (optional)

# example passing only required values which don't have defaults set
# and optional values
try:
# Get Red Notices
api_response = api_instance.notices_v1_red_get(forename=forename, name=name, nationality=nationality, age_max=age_max, age_min=age_min, free_text=free_text, sex_id=sex_id, arrest_warrant_country_id=arrest_warrant_country_id, page=page, result_per_page=result_per_page)
pprint(api_response)
except interpol.ApiException as e:
print("Exception when calling DefaultApi->notices_v1_red_get: %s\n" % e)

```

```
Traceback (most recent call last):
File "main.py", line 32, in
api_response = api_instance.notices_v1_red_get(forename=forename, name=name, nationality=nationality, age_max=age_max, age_min=age_min, free_text=free_text, sex_id=sex_id, arrest_warrant_country_id=arrest_warrant_country_id, page=page, result_per_page=result_per_page)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api/default_api.py", line 263, in notices_v1_red_get
return self.notices_v1_red_get_endpoint.call_with_http_info(**kwargs)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 950, in call_with_http_info
return self.api_client.call_api(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 432, in call_api
return self.__call_api(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 236, in __call_api
return_data = self.deserialize(response_data, response_type, _check_type)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/api_client.py", line 344, in deserialize
deserialized_data = validate_and_convert_types(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1607, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1468, in attempt_convert_item
return deserialize_model(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1378, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 358, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model/red_notices.py", line 202, in _from_openapi_data
setattr(self, var_name, var_value)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 179, in __setattr__
self[attr] = value
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 496, in __setitem__
self.set_attribute(name, value)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 155, in set_attribute
value = validate_and_convert_types(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1607, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1468, in attempt_convert_item
return deserialize_model(
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 1378, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 48, in wrapped_init
return fn(_self, *args, **kwargs)
File "/home/raphael/.cache/pypoetry/virtualenvs/deutschland-test-pypi-tmto6Anq-py3.8/lib/python3.8/site-packages/deutschland/interpol/model_utils.py", line 358, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
TypeError: wrapped_init() got multiple values for argument '_self'

```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Tái hiện ví dụ trong thư mục doc và bắt đầu từ notices_v1_red_get trong interpol/api/default_api.py, lần theo traceback qua api_client.py, model_utils.py và model/red_notices.py. Công việc hoàn tất khi request được ghi trong tài liệu không còn gây ra TypeError đã nêu và hoàn thành thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.