Annotation Type Server
-
@Target({METHOD,TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Repeatable(Servers.class) @Inherited public @interface Server
The annotation may be applied at class or method level, or inOperation.servers()
to define servers for the single operation (when applied at method level) or for all operations of a class (when applied at class level).It can also be used in
OpenAPIDefinition.servers()
to define spec level servers.- See Also:
- Server (OpenAPI specification),
OpenAPIDefinition
,Operation
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String
description
An optional string describing the host designated by the URL.Extension[]
extensions
The list of optional extensionsString
url
Required.ServerVariable[]
variables
An array of variables used for substitution in the server's URL template.
-
-
-
Element Detail
-
url
String url
Required. A URL to the target host. This URL supports Server Variables and may be relative, to indicate that the host location is relative to the location where the OpenAPI definition is being served. Variable substitutions will be made when a variable is named in {brackets}.- Returns:
- String url
- Default:
- ""
-
-
-
description
String description
An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.- Returns:
- String description
- Default:
- ""
-
-
-
variables
ServerVariable[] variables
An array of variables used for substitution in the server's URL template.- Returns:
- array of ServerVariables
- Default:
- {}
-
-
-
extensions
Extension[] extensions
The list of optional extensions- Returns:
- an optional array of extensions
- Default:
- {}
-
-