at-least-one-path-item
Overview
This rule belongs to the openapi-v3-codegen-linting
ruleset and states that:
An OpenAPI specification must contain at least one path. The paths property of an OpenAPI specification defines the available endpoints of the API, and each endpoint must have a unique path. An API with no paths defined is considered invalid and cannot be used by clients to make requests.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | An API must contain at least one path item. |
Code | OPENAPI3CODEGEN_L160 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Paths |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | code generation sdks openapi3 openapi semantic linting apimatic paths path |
Suggested Fixes
- Review the OpenAPI specification and ensure that the paths property is defined.
- Check that at least one path is defined under the paths property.
- If no paths are defined, add at least one path with a unique URL endpoint to the paths property.
- Ensure that the new path is well-defined and follows the OpenAPI specification conventions, including the use of parameters, responses, and other relevant properties.