openai / openai/openai-openapi

Inline union schemas produce unstable generated type names (Object124, etc.)

Open
#522 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement specification
Dominant language
No language data
Stars
2.5k
Forks
527
Avg merge
1h 46m
Merged PRs (30d)
2

Description

Issue:
Inline schemas in anyOf/oneOf (e.g., VideoModel) cause code generators to emit numbered types like Object124 that shift on every spec update, breaking typed clients in Python, TypeScript, Go, Java, and C#.

Fix:
Either promote inline schemas to named components, or add title properties to inline schemas, e.g.,

VideoModelEnum:
  type: string
  enum:
    - sora-2
    - sora-2-pro

VideoModel:
  anyOf:
    - type: string
    - $ref: "#/components/schemas/VideoModelEnum"

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 locating the inline anyOf/oneOf schemas such as VideoModel in the OpenAPI specification and compare generated type names across Python, TypeScript, Go, Java, and C# clients. The work is done when these schemas use named components or title properties and generated names remain stable after a specification update.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, go, java, openapi, python, typescript
Domain
api
Issue type
Bug
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.