openapi-generators / openapi-generators/openapi-python-client

Lots of warnings when generating the geofox gti api

Đang mở
#608 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

🐞bug
Ngôn ngữ chính
Python
Star
2k
Fork
293
Merge trung bình
34 phút
Pull request đã merge (30 ngày)
1

Mô tả

When running openapi-python-client on the gti geofox api I get a lot of warnings:

$ openapi-python-client generate --url https://gti.geofox.de/v3/api-docs/public
Generating open-api-definition-client
Warning(s) encountered while generating. Client was generated, but some pieces may be missing

WARNING parsing POST /gti/public/ticketList within ticket_list_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/TicketListResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/tariffZoneNeighbours within tariff_zone_neighbours_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/TariffZoneNeighboursResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/tariffMetaData within tariff_meta_data_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/TariffMetaDataResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/singleTicketOptimizer within single_ticket_optimizer_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/SingleTicketOptimizerResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/listStations within list_stations_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/LSResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/listLines within list_lines_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/LLResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/init within init_request_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/InitResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/getVehicleMap within vehicle_map_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/VehicleMapResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/getTrackCoordinates within track_coords_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/TrackCoordinatesResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/getTariff within tariff_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/TariffResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/getStationInformation within station_information_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/StationInformationResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/getRoute within get_route_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/GRResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/getIndividualRoute within individual_route_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/IndividualRouteResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/getAnnouncements within announcement_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/AnnouncementResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/departureList within departure_list_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/DLResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/departureCourse within departure_course_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/DCResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/checkPostalCode within postal_code_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/PCResponse'), example=None, examples=None, encoding=None)}, links=None)

WARNING parsing POST /gti/public/checkName within check_name_controller.

Cannot parse response for status code 200, response will be ommitted from generated client

Response(description='OK', headers=None, content={'*/*': MediaType(media_type_schema=Reference(ref='#/components/schemas/CNResponse'), example=None, examples=None, encoding=None)}, links=None)

If you believe this was a mistake or this tool is missing a feature you need, please open an issue at https://github.com/openapi-generators/openapi-python-client/issues/new/choose

After generation, all the api files only contain sync_detailed and asyncio_detailed methods. sync and async methods are missing, e.g.:

$ grep def open-api-definition-client/open_api_definition_client/api/announcement_controller/get_announcements.py 
def _get_kwargs(
def _build_response(*, response: httpx.Response) -> Response[Any]:
def sync_detailed(
async def asyncio_detailed(

Is this a bug in your code or something I should report to Geofox?

$ openapi-python-client --version
openapi-python-client version: 0.11.1

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện bằng openapi-python-client generate --url https://gti.geofox.de/v3/api-docs/public với phiên bản 0.11.1, sau đó kiểm tra tệp được tạo open_api_definition_client/api/announcement_controller/get_announcements.py và các tệp API bị ảnh hưởng khác. So sánh các định nghĩa response của Geofox với hành vi parsing của generator; được xem là hoàn tất khi các response hợp lệ tạo ra các convenience method như mong đợi mà không có các cảnh báo đã báo cáo, hoặc chứng minh được rằng vấn đề thuộc về specification của Geofox.

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
tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/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.