Package org.eclipse.microprofile.openapi.models.servers


@Version("1.0") package org.eclipse.microprofile.openapi.models.servers
Model interfaces to represent servers used for a single API operation or for all operations in an OpenAPI document, as well as a way to represent variables for server URL template substitution.

The behaviour of methods inherited from java.lang.Object are undefined by the MicroProfile OpenAPI specification.

Example usage:

 Override
  public OpenAPI buildModel() {
      return OASFactory.createObject(OpenAPI.class)
          .servers(new ArrayList<Server>())
              .addServer(OASFactory.createObject(Server.class)
                  .url("https://{username}.gigantic-server.com:{port}/{basePath}")
                  .description("The production API server")
                  .variables(OASFactory.createObject(ServerVariables.class)
                      .addServerVariable("username", OASFactory.createObject(ServerVariable.class)
                          .defaultValue("user1")
                          .description("Reviews of the app by users")
                          .enumeration(new ArrayList<String>())
                              .addEnumeration("user1")
                              .addEnumeration("user2")))
 
  • Interfaces
    Class
    Description
    An object representing a server.
    An object representing a Server Variable for server URL template substitution.
    ServerVariables