Server object variable is not used in any server URLs

Description

The variable you have defined in the server variables is not used in any URLs in your API definition. All variables defined in the variables property map of the server object must be used in an url property in the API definition.

For more details, see the OpenAPI Specification.

Example

The following is an example of how this issue could look in your API definition. The variable foo has been defined in the variables map, but is not used in the URL:

1servers:
2  - url: https://{username}.gigantic-server.com:{port}/{basePath}
3    description: The production API server
4    variables:
5      port:
6        enum:
7          - "8443"
8          - "443"
9        default: "8443"
10      basePath:
11        default: v2
12      foo:
13        default: bar
14

Remediation

Make sure that all variables you have defined in the variables maps of server objects are either used in URLs or removed.

1servers:
2  - url: https://{user-name}.gigantic-server.com:{port}/{basePath}
3    description: The production API server
4    variables:
5      username:
6        default: demo
7        description: this value is assigned by the service provider, in this example
8          `gigantic-server.com`
9      port:
10        enum:
11          - "8443"
12          - "443"
13        default: "8443"
14      basePath:
15        default: v2
16

Copyright 42Crunch 2021