openai / openai/openai-openapi
Add explicit discriminator mappings for Realtime session configuration unions
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 2.5k
- Forks
- 527
- Avg merge
- 1h 46m
- Merged PRs (30d)
- 2
Description
The Realtime session configuration union is currently represented using oneOf in:
RealtimeClientEventSessionUpdate.properties.sessionRealtimeCreateClientSecretRequest.properties.session
Both referenced schemas require a type property with distinct constant values:
RealtimeSessionCreateRequestGA:type: realtimeRealtimeTranscriptionSessionCreateRequestGA:type: transcription
However, the union does not explicitly declare its discriminator. This prevents some OpenAPI consumers and code generators from recognizing it as a discriminated union.
Could the schema include an explicit discriminator mapping?
session:
type: object
description: |
Update the Realtime session. Choose either a realtime
session or a transcription session.
oneOf:
- $ref: "#/components/schemas/RealtimeSessionCreateRequestGA"
- $ref: "#/components/schemas/RealtimeTranscriptionSessionCreateRequestGA"
discriminator:
propertyName: type
mapping:
realtime: "#/components/schemas/RealtimeSessionCreateRequestGA"
transcription: "#/components/schemas/RealtimeTranscriptionSessionCreateRequestGA"
Alternatively, the union could be extracted into a reusable component and referenced from both properties.
This would preserve the existing wire format while making the intended polymorphism explicit for OpenAPI tooling.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the schemas for RealtimeClientEventSessionUpdate.properties.session and RealtimeCreateClientSecretRequest.properties.session, then read the referenced RealtimeSessionCreateRequestGA and RealtimeTranscriptionSessionCreateRequestGA definitions. Add the explicit type discriminator mapping to both unions, or identify a reusable component if the repository structure supports it. Done means the existing wire format is unchanged and both session variants are recognized as a discriminated union.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- Half a day
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100