Interface OpenAPI

All Superinterfaces:
Constructible, Extensible<OpenAPI>

public interface OpenAPI extends Constructible, Extensible<OpenAPI>
OpenAPI

This is the root document object of the OpenAPI document. It contains required and optional fields.

See Also:
  • Method Details

    • getOpenapi

      String getOpenapi()
      Returns the openapi property from an OpenAPI instance.
      Returns:
      the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
    • setOpenapi

      void setOpenapi(String openapi)
      Sets this OpenAPI instance's openapi property to the given string.
      Parameters:
      openapi - the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
    • openapi

      default OpenAPI openapi(String openapi)
      Sets this OpenAPI instance's openapi property to the given string.
      Parameters:
      openapi - the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
      Returns:
      the current OpenAPI object
    • getInfo

      Info getInfo()
      Returns the info property from an OpenAPI instance.
      Returns:
      metadata about the API
    • setInfo

      void setInfo(Info info)
      Sets this OpenAPI instance's info property to the given object.
      Parameters:
      info - metadata about the API
    • info

      default OpenAPI info(Info info)
      Sets this OpenAPI instance's info property to the given object.
      Parameters:
      info - metadata about the API
      Returns:
      the current OpenAPI object
    • getExternalDocs

      ExternalDocumentation getExternalDocs()
      Returns the externalDocs property from an OpenAPI instance.
      Returns:
      additional external documentation
    • setExternalDocs

      void setExternalDocs(ExternalDocumentation externalDocs)
      Sets this OpenAPI instance's externalDocs property to the given object.
      Parameters:
      externalDocs - additional external documentation.
    • externalDocs

      default OpenAPI externalDocs(ExternalDocumentation externalDocs)
      Sets this OpenAPI instance's externalDocs property to the given object.
      Parameters:
      externalDocs - additional external documentation
      Returns:
      the current OpenAPI object
    • getServers

      List<Server> getServers()
      Returns the Servers defined in the API
      Returns:
      Server objects which provide connectivity information to target servers
    • setServers

      void setServers(List<Server> servers)
      Sets this OpenAPI instance's servers property to the given servers.
      Parameters:
      servers - Server objects which provide connectivity information to target servers
    • servers

      default OpenAPI servers(List<Server> servers)
      Sets this OpenAPI instance's servers property to the given servers.
      Parameters:
      servers - Server objects which provide connectivity information to target servers
      Returns:
      the current OpenAPI object
    • addServer

      OpenAPI addServer(Server server)
      Adds the given server to this OpenAPI instance's list of servers.
      Parameters:
      server - Server object which provides connectivity information to a target server
      Returns:
      the current OpenAPI object
    • removeServer

      void removeServer(Server server)
      Removes the given server to this OpenAPI instance's list of servers.
      Parameters:
      server - Server object which provides connectivity information to a target server
    • getSecurity

      List<SecurityRequirement> getSecurity()
      Returns the security property from an OpenAPI instance.
      Returns:
      which security mechanisms can be used across the API
    • setSecurity

      void setSecurity(List<SecurityRequirement> security)
      Sets this OpenAPI instance's security property to the given list.
      Parameters:
      security - which security mechanisms can be used across the API
    • security

      default OpenAPI security(List<SecurityRequirement> security)
      Sets this OpenAPI instance's security property to the given list.
      Parameters:
      security - which security mechanisms can be used across the API
      Returns:
      the current OpenAPI object
    • addSecurityRequirement

      OpenAPI addSecurityRequirement(SecurityRequirement securityRequirement)
      Adds the given security requirement to this OpenAPI instance's list of security requirements.
      Parameters:
      securityRequirement - security mechanism which can be used across the API
      Returns:
      the current OpenAPI object
    • removeSecurityRequirement

      void removeSecurityRequirement(SecurityRequirement securityRequirement)
      Removes the given security requirement to this OpenAPI instance's list of security requirements.
      Parameters:
      securityRequirement - security mechanism which can be used across the API
    • getTags

      List<Tag> getTags()
      Returns the tags property from an OpenAPI instance.
      Returns:
      tags used by the specification
    • setTags

      void setTags(List<Tag> tags)
      Sets this OpenAPI instance's tags property to the given Tags.
      Parameters:
      tags - tags used by the specification with additional metadata
    • tags

      default OpenAPI tags(List<Tag> tags)
      Sets this OpenAPI instance's tags property to the given tags.
      Parameters:
      tags - tags used by the specification with additional metadata
      Returns:
      the current OpenAPI object
    • addTag

      OpenAPI addTag(Tag tag)
      Adds the given tag to this OpenAPI instance's list of tags.
      Parameters:
      tag - a tag used by the specification with additional metadata
      Returns:
      the current OpenAPI object
    • removeTag

      void removeTag(Tag tag)
      Removes the given tag to this OpenAPI instance's list of tags.
      Parameters:
      tag - a tag used by the specification with additional metadata
    • getPaths

      Paths getPaths()
      Returns the paths property from an OpenAPI instance.
      Returns:
      the available paths and operations for the API
    • setPaths

      void setPaths(Paths paths)
      Sets this OpenAPI instance's paths property to the given paths.
      Parameters:
      paths - the available paths and operations for the API
    • paths

      default OpenAPI paths(Paths paths)
      Sets this OpenAPI instance's paths property to the given paths.
      Parameters:
      paths - the available paths and operations for the API
      Returns:
      the current OpenAPI object
    • path

      @Deprecated OpenAPI path(String name, PathItem path)
      Deprecated.
      since 1.1, use @link Paths.addPathItem(String, PathItem) on getPaths() instead
      Adds the given path item to this OpenAPI instance's list of paths
      Parameters:
      name - a path name in the format valid for a Paths object
      path - the path item added to the list of paths
      Returns:
      the current OpenAPI object
    • getComponents

      Components getComponents()
      Returns the components property from an OpenAPI instance.
      Returns:
      schemas used in the specification
    • setComponents

      void setComponents(Components components)
      Sets this OpenAPI instance's components property to the given components.
      Parameters:
      components - a set of reusable objects used in the API specification
    • components

      default OpenAPI components(Components components)
      Sets this OpenAPI instance's components property to the given components.
      Parameters:
      components - a set of reusable objects used in the API specification
      Returns:
      the current OpenAPI object