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

Name conflict between `models.Response` and `types.Response`

Open
#1,081 1 comment 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

I ran into an OpenAPI spec which included a Response type. That caused a name conflict in the generated python code:

from ...models.response import Response
from ...types import Response

This was fixed easily enough using a class_overrides config, but since the classes in types.py are pretty generic I think it would be better if the classes were just fully qualified to avoid this kind of conflict.

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 tracing how generated models and the classes in types.py are named and imported. Reproduce the conflict with an OpenAPI spec containing a Response type, then verify that generated Python imports no longer collide while class_overrides remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.