Annotation Type Server
-
@Target({TYPE,METHOD}) @Retention(RUNTIME) @Repeatable(Servers.class) @Inherited public @interface Server
This annotation represents a Server used in an operation or used by all operations in an OpenAPI document.When a Server annotation appears on a method the server is added to the corresponding OpenAPI operation servers field.
When a Server annotation appears on a type then the server is added to all the operations defined in that type except for those operations which already have one or more servers defined. The server is also added to the servers defined in the root level of the OpenAPI document.
This annotation is
Repeatable
.Note: If both
Server
andServers
annotation are specified on the same type, the server definitions will be combined.- See Also:
- OpenAPI Specification Server Object
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String
description
An optional string describing the host designated by the URL.java.lang.String
url
A URL to the target host.ServerVariable[]
variables
An array of variables used for substitution in the server's URL template.
-
-
-
Element Detail
-
url
java.lang.String url
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}. This is a REQUIRED property.- Returns:
- URL to the target host
- Default:
- ""
-
-
-
variables
ServerVariable[] variables
An array of variables used for substitution in the server's URL template.- Returns:
- array of variables
- Default:
- {}
-
-