server-url-not-example-dot-com
Overview
This rule belongs to the openapi-v3-codegen-linting
ruleset and states that:
The domain name example.com is reserved by the Internet Engineering Task Force (IETF) for use in documentation and examples, and it should not be used as an actual domain name in production environments. This rule enforces the requirement that server URLs in an OpenAPI specification should not point to example.com, in order to avoid any potential confusion or conflicts with the reserved domain name.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Server URLs should not point to example.com. |
Code | OPENAPI3CODEGEN_L096 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Servers |
Products Impacted | Code Generation, Developer Experience Portal |
Tags | code generation sdks openapi3 openapi semantic linting apimatic servers server api url example.com |
Suggested Fixes
- Review the OpenAPI specification and locate the servers property that lists the servers used to access the API.
- Check the url property of each server definition to ensure that it does not point to example.com.
- If any server definition points to example.com, replace it with a valid URL that points to the server hosting the API.
- If the API is not yet hosted, use a valid domain name that will be used to host the API in the future.