Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageServer URLs should not point to example.com.
CodeOPENAPI3CODEGEN_L096
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Servers
Products ImpactedCode Generation, Developer Experience Portal
Tagscode 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.

For More Information