Create a rule to detect when another component type is referenced inside Schema
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.
This is an extension of this issue - #767
There's a repeatable mistake when some other components type (for example, requestBody) is referenced inside the Schema component.
Example definition:
# openapi.yaml
openapi: 3.0.0
components:
requestBodies:
CreateContainer:
content:
application/json:
schema:
type: object
schemas:
PipeContainerCreate:
title: PipelineContainerCreate
allOf:
- "$ref": "#/components/requestBodies/CreateContainer"
Describe the solution you'd like
Create a rule to detect and flag this type of mistake.
Describe alternatives you've considered
The messaging inside the spec rule was improved, but it might not be enough.
Additional context
N/a
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 by reviewing issue #767 and the existing spec rule, then use the openapi.yaml example to understand how a requestBodies reference appears inside a schema. The rule should flag references to another components type from a Schema component; verify the diagnostic against the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100