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

Parsing Error

Open
#1,197 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
293
Avg merge
34m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by downloading the Wyscout OpenAPI v3 document and rerunning poetry run openapi-python-client generate --path path_to_file with openapi-python-client 0.23.1. Trace the model filename generation indicated by the models/match_events...py path and determine how the long parsed fields produce the filesystem error. Done means the specification generates without a filename-too-long error and the output is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.