Response samples lists sub-types when base-type has a discriminator.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
Basically I have a base type and sub-types.
Whenever I try to refer to sub-type then in the doc it gives all the sub-types of base-type.
For example:
In this patch of code, I am using TestingFolderResponse (sub-type) for the response.

And the TestingFolderResponse and TestingParserResponse sub-types looks like this:

And my base-type looks like:

In docs, instead of just listing TestingFolderResponse properties, it is giving an option between TestingFolderResponse and TestingParserResponse as shown instead of just listing TestingFolderResponse

Not sure if this is the expected behaviour.
But according to me, sub-types shouldn’t know about base-type. This happens only when I add a discriminator in my base-type. Can someone help me with this?
And also, is there a workaround to fix this issue?
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
No files, tests, or entry points are named. Start by reproducing the response documentation with TestingFolderResponse and TestingParserResponse inheriting from a discriminated base type, then verify that the rendered response lists only TestingFolderResponse rather than both sub-types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100