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

Parsing Error

未關閉
#1,197 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
2k
分支
293
平均合併
34 分鐘
30 天內合併 PR
1

描述

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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先下載 Wyscout OpenAPI v3 文件,並使用 openapi-python-client 0.23.1 重新執行 poetry run openapi-python-client generate --path path_to_file。追蹤 models/match_events...py 路徑所指出的模型檔案名稱產生流程,並判斷解析後的長欄位如何造成檔案系統錯誤。完成的條件是規格能在不出現 filename-too-long 錯誤的情況下產生,且輸出完整。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
openapi, python
領域
api, tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。