Class OpenAPIObjectBuilder


  • public class OpenAPIObjectBuilder
    extends java.lang.Object
    This is the root document object of the OpenAPI document.
    • Constructor Detail

      • OpenAPIObjectBuilder

        public OpenAPIObjectBuilder()
    • Method Detail

      • withInfo

        public OpenAPIObjectBuilder withInfo​(InfoObject info)
        Parameters:
        info - REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.
        Returns:
        The current builder
      • withServers

        public OpenAPIObjectBuilder withServers​(java.util.List<ServerObject> servers)
        Parameters:
        servers - An array of Server Objects, which provide connectivity information to a target server. If the servers property is not provided, or is an empty array, the default value would be a ServerObject with a url value of /.
        Returns:
        The current builder
      • withPaths

        public OpenAPIObjectBuilder withPaths​(PathsObject paths)
        Parameters:
        paths - REQUIRED. The available paths and operations for the API.
        Returns:
        The current builder
      • withComponents

        public OpenAPIObjectBuilder withComponents​(ComponentsObject components)
        Parameters:
        components - An element to hold various schemas for the specification.
        Returns:
        The current builder
      • withSecurity

        public OpenAPIObjectBuilder withSecurity​(java.util.List<SecurityRequirementObject> security)
        Parameters:
        security - A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
        Returns:
        The current builder
      • withTags

        public OpenAPIObjectBuilder withTags​(java.util.List<TagObject> tags)
        Parameters:
        tags - A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the OperationObject must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
        Returns:
        The current builder