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

use key not title for class name

Open
#652 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

in components -> schemas
Screenshot from 2022-08-10 22-53-44
here i have erros:

Unable to parse schema /components/schemas/HRVSample

Unable to parse this part of your OpenAPI document: : Attempted to generate duplicate models with name "Sample"

why used the title for class names and not the key. The key is always unique, but the title is not necessarily unique.

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 with the OpenAPI components/schemas entry for HRVSample and trace how the client generator derives model class names from its key and title. Done means schemas with distinct keys but the same title generate distinct models without the duplicate-model error shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.