Add support for allOf to the discriminator
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 228
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
Description
Is your feature request related to a problem? Please describe.
Currently Redocly CLI doesn't validate the no-invalid-media-type-examples rule when a schema uses allOf in discriminator.
Describe the solution you'd like
Add support to the allOf in discriminator (most likely on the ajv side).
Describe alternatives you've considered
Explicitly prohibit using allOf in discriminator.
Additional context
We had a similar issue before: https://github.com/Redocly/redocly-cli/issues/700
Also a related conversation: https://redoc-ly.slack.com/archives/C04HZU8SZR7/p1674039829587489
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
Start with the no-invalid-media-type-examples rule and the linked Redocly/ajv dependency, then trace how discriminator schemas are handled. Reproduce validation for a discriminator using allOf and verify that valid media-type examples pass while invalid examples still fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100