Support JSON-schema assertion in configurable rules
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.
Some people maintain JSON schemas to validate some parts of OpenAPI. We don't have a way to use them.
Describe the solution you'd like
I would like to add support for json schema assertion for our configurable rules. It may look like this:
rule/info-metadata-check:
subject:
type: Info
property: x-metadata
message: Metadata should match the schema.
assertions:
json-schema:
$ref: ./metadata-schema.json
Describe alternatives you've considered
Right now it is possible to achieve using custom assertions/rules via plugin: https://redocly.com/docs/cli/rules/configurable-rules#custom-function-example
Additional context
Reported in Write the Docs slack: https://writethedocs.slack.com/archives/C4EPE8332/p1738793608940479
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
The issue names no files or tests; start with the linked configurable-rules custom-function example and trace the assertion-handling entry point. Use the shown rule configuration to determine how a referenced JSON Schema should be loaded, applied, and reported, then add coverage demonstrating that the assertion works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100