path-item-reference-is-a-path-item-object
Overview
This rule belongs to the swagger-v2-standards-validation ruleset and states that:
When $ref is used within a Path Item Object, it must point to a valid Path Item Object defined elsewhere and which will replace the current Path Item Object with its contents. The $ref must eventually resolve into a Path Item Object (and no other type of object). The resolved object should not contain $ref as a property i.e. the references must not form an endless loop.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Referenced path object is not a valid Path Item Object. |
| Code | SWAGGER20STANDARDS_V050 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Path Items |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger2 swagger standards semantic validation paths path $ref |
Suggested Fixes
- Ensure that the path provided in $ref is a valid path to a Path Item Object.
- Ensure that the component you are trying to reference using $ref is indeed a Path Item Object.
- A Path Item Object generally contains a few operation definitions using keys like get, post, put, delete, etc.