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

Parsing Error

Đang mở
#1,197 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.

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ả

Describe the bug
I tried to parse the v3 openapi specification as can be downloaded here
https://apidocs.wyscout.com/
I ran

poetry run openapi-python-client generate --path path_to_file

It worked halfway. Quite a few of the model files were generated, but it was incomplete.
The error message I got was

File name too long: 
'[...]wyscout-api-v-3-client/wyscout_api_v_3_client/models/match_events_a_response_element_object_substitution_fetch_the_substitutions_related_to_the_team_with_id_team_id_the_substitutions_related_to_match_p
eriod_match_period_the_substitution_that_happened_at_start_sec_seconds_elapsed_from_the_start_the_entrance_of_a_player_as_a_substitute.py'

which suggested that some fields that were not meant for parsing got parsed into a header.

OpenAPI Spec File
A link to an OpenAPI document which produces this issue. Ideally, write a minimal reproduction only containing the problematic pieces.

Desktop (please complete the following information):

  • MacOS 15.1.1 (24B91)
  • Python Version: 3.12.7
  • openapi-python-client version 0.23.1

Additional context
Thank you for your help

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

Bắt đầu bằng cách tải xuống tài liệu Wyscout OpenAPI v3 và chạy lại poetry run openapi-python-client generate --path path_to_file với openapi-python-client 0.23.1. Truy vết quá trình tạo tên tệp model được chỉ ra bởi đường dẫn models/match_events...py và xác định cách các trường đã phân tích cú pháp có tên dài gây ra lỗi hệ thống tệp. Được xem là hoàn tất khi đặc tả được tạo mà không có lỗi filename-too-long và đầu ra đầy đủ.

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

Đánh giá

Công nghệ
openapi, python
Lĩnh vực
api, 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
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.