Interface Components

  • All Superinterfaces:
    Constructible, Extensible


    public interface Components
    extends Constructible, Extensible
    Components

    Holds a set of reusable objects for different aspects of the API specification. All objects defined within this object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

    All the fields are indexed by keys that must match the regular expression: ^[a-zA-Z0-9\.\-_]+$.

    Key Examples:

    • User
    • User_1
    • User_Name
    • user-name
    • my.org.User
    See Also:
    OpenAPI Specification Components Object
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Components addCallback​(java.lang.String key, Callback callback)
      Adds the given callback to this Components' map of callbacks with the given string as its key.
      Components addExample​(java.lang.String key, Example example)
      Adds the given example to this Components' map of examples with the given string as its key.
      Components addHeader​(java.lang.String key, Header header)
      Adds the given header to this Components' map of headers with the given string as its key.
      Components addLink​(java.lang.String key, Link link)
      Adds the given link to this Components' map of links with the given string as its key.
      Components addParameter​(java.lang.String key, Parameter parameter)
      Adds the given parameter to this Components' map of parameters with the given string as its key.
      Components addRequestBody​(java.lang.String key, RequestBody requestBody)
      Adds the given request body to this Components' map of request bodies with the given string as its key.
      Components addResponse​(java.lang.String key, APIResponse response)
      Adds the given response to this Components' map of responses with the given string as its key.
      Components addSchema​(java.lang.String key, Schema schema)
      Adds the given schema to this Components' list of schemas with the given string as its key.
      Components addSecurityScheme​(java.lang.String key, SecurityScheme securityScheme)
      Adds the given security scheme to this Components' map of security schemes with the given string as its key.
      Components callbacks​(java.util.Map<java.lang.String,Callback> callbacks)
      Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.
      Components examples​(java.util.Map<java.lang.String,Example> examples)
      Sets this Components' examples property to the given Map containing keys and reusable example objects.
      java.util.Map<java.lang.String,Callback> getCallbacks​()
      Returns the callbacks property from a Components instance.
      java.util.Map<java.lang.String,Example> getExamples​()
      Returns the examples property from a Components instance.
      java.util.Map<java.lang.String,Header> getHeaders​()
      Returns the headers property from a Components instance.
      java.util.Map<java.lang.String,Link> getLinks​()
      Returns the links property from a Components instance.
      java.util.Map<java.lang.String,Parameter> getParameters​()
      Returns the parameters property from a Components instance.
      java.util.Map<java.lang.String,RequestBody> getRequestBodies​()
      Returns the requestBodies property from a Components instance.
      java.util.Map<java.lang.String,APIResponse> getResponses​()
      Returns the responses property from a Components instance.
      java.util.Map<java.lang.String,Schema> getSchemas​()
      Returns the schemas property from a Components instance.
      java.util.Map<java.lang.String,SecurityScheme> getSecuritySchemes​()
      Returns the securitySchemes property from a Components instance.
      Components headers​(java.util.Map<java.lang.String,Header> headers)
      Sets this Components' headers property to the given Map containing keys and reusable header objects.
      Components links​(java.util.Map<java.lang.String,Link> links)
      Sets this Components' links property to the given Map containing keys and reusable link objects.
      Components parameters​(java.util.Map<java.lang.String,Parameter> parameters)
      Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.
      Components requestBodies​(java.util.Map<java.lang.String,RequestBody> requestBodies)
      Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.
      Components responses​(java.util.Map<java.lang.String,APIResponse> responses)
      Sets this Components' responses property to the given Map containing keys and reusable response objects.
      Components schemas​(java.util.Map<java.lang.String,Schema> schemas)
      Sets this Components' schemas property to the given Map containing keys and reusable schemas.
      Components securitySchemes​(java.util.Map<java.lang.String,SecurityScheme> securitySchemes)
      Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.
      void setCallbacks​(java.util.Map<java.lang.String,Callback> callbacks)
      Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.
      void setExamples​(java.util.Map<java.lang.String,Example> examples)
      Sets this Components' examples property to the given Map containing keys and reusable example objects.
      void setHeaders​(java.util.Map<java.lang.String,Header> headers)
      Sets this Components' headers property to the given Map containing keys and reusable header objects.
      void setLinks​(java.util.Map<java.lang.String,Link> links)
      Sets this Components' links property to the given Map containing keys and reusable link objects.
      void setParameters​(java.util.Map<java.lang.String,Parameter> parameters)
      Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.
      void setRequestBodies​(java.util.Map<java.lang.String,RequestBody> requestBodies)
      Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.
      void setResponses​(java.util.Map<java.lang.String,APIResponse> responses)
      Sets this Components' responses property to the given Map containing keys and reusable response objects.
      void setSchemas​(java.util.Map<java.lang.String,Schema> schemas)
      Sets this Components' schemas property to the given Map containing keys and reusable schema objects.
      void setSecuritySchemes​(java.util.Map<java.lang.String,SecurityScheme> securitySchemes)
      Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.
    • Method Detail

      • getSchemas

        java.util.Map<java.lang.String,Schema> getSchemas​()
        Returns the schemas property from a Components instance.
        Returns:
        a Map containing the keys and the reusable schemas for this OpenAPI document
      • setSchemas

        void setSchemas​(java.util.Map<java.lang.String,Schema> schemas)
        Sets this Components' schemas property to the given Map containing keys and reusable schema objects.
        Parameters:
        schemas - a Map containing keys and reusable schema objects
      • schemas

        Components schemas​(java.util.Map<java.lang.String,Schema> schemas)
        Sets this Components' schemas property to the given Map containing keys and reusable schemas.
        Parameters:
        schemas - a Map containing keys and reusable schemas
        Returns:
        the current Components object
      • addSchema

        Components addSchema​(java.lang.String key,
                             Schema schema)
        Adds the given schema to this Components' list of schemas with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        schema - a reusable schema object
        Returns:
        the current Components object
      • getResponses

        java.util.Map<java.lang.String,APIResponse> getResponses​()
        Returns the responses property from a Components instance.
        Returns:
        a Map containing the keys and the reusable responses from API operations for this OpenAPI document
      • setResponses

        void setResponses​(java.util.Map<java.lang.String,APIResponse> responses)
        Sets this Components' responses property to the given Map containing keys and reusable response objects.
        Parameters:
        responses - a Map containing keys and reusable response objects
      • responses

        Components responses​(java.util.Map<java.lang.String,APIResponse> responses)
        Sets this Components' responses property to the given Map containing keys and reusable response objects.
        Parameters:
        responses - a Map containing keys and reusable response objects
        Returns:
        the current Components object
      • addResponse

        Components addResponse​(java.lang.String key,
                               APIResponse response)
        Adds the given response to this Components' map of responses with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        response - a reusable response object
        Returns:
        the current Components object
      • getParameters

        java.util.Map<java.lang.String,Parameter> getParameters​()
        Returns the parameters property from a Components instance.
        Returns:
        a Map containing the keys and the reusable parameters of API operations for this OpenAPI document
      • setParameters

        void setParameters​(java.util.Map<java.lang.String,Parameter> parameters)
        Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.
        Parameters:
        parameters - a Map containing keys and reusable parameter objects
      • parameters

        Components parameters​(java.util.Map<java.lang.String,Parameter> parameters)
        Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.
        Parameters:
        parameters - a Map containing keys and reusable parameter objects
        Returns:
        the current Components object
      • addParameter

        Components addParameter​(java.lang.String key,
                                Parameter parameter)
        Adds the given parameter to this Components' map of parameters with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        parameter - a reusable parameter object
        Returns:
        the current Components object
      • getExamples

        java.util.Map<java.lang.String,Example> getExamples​()
        Returns the examples property from a Components instance.
        Returns:
        a Map containing the keys and the reusable examples for this OpenAPI document
      • setExamples

        void setExamples​(java.util.Map<java.lang.String,Example> examples)
        Sets this Components' examples property to the given Map containing keys and reusable example objects.
        Parameters:
        examples - a Map containing keys and reusable example objects
      • examples

        Components examples​(java.util.Map<java.lang.String,Example> examples)
        Sets this Components' examples property to the given Map containing keys and reusable example objects.
        Parameters:
        examples - a Map containing keys and reusable example objects
        Returns:
        the current Components object
      • addExample

        Components addExample​(java.lang.String key,
                              Example example)
        Adds the given example to this Components' map of examples with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        example - a reusable example object
        Returns:
        the current Components object
      • getRequestBodies

        java.util.Map<java.lang.String,RequestBody> getRequestBodies​()
        Returns the requestBodies property from a Components instance.
        Returns:
        a Map containing the keys and the reusable request bodies for this OpenAPI document
      • setRequestBodies

        void setRequestBodies​(java.util.Map<java.lang.String,RequestBody> requestBodies)
        Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.
        Parameters:
        requestBodies - a Map containing the keys and reusable request body objects
      • requestBodies

        Components requestBodies​(java.util.Map<java.lang.String,RequestBody> requestBodies)
        Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.
        Parameters:
        requestBodies - a Map containing the keys and reusable request body objects
        Returns:
        the current Components object
      • addRequestBody

        Components addRequestBody​(java.lang.String key,
                                  RequestBody requestBody)
        Adds the given request body to this Components' map of request bodies with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        requestBody - a reusable request body object
        Returns:
        the current Components object
      • getHeaders

        java.util.Map<java.lang.String,Header> getHeaders​()
        Returns the headers property from a Components instance.
        Returns:
        a Map containing the keys and the reusable headers for this OpenAPI document
      • setHeaders

        void setHeaders​(java.util.Map<java.lang.String,Header> headers)
        Sets this Components' headers property to the given Map containing keys and reusable header objects.
        Parameters:
        headers - a Map containing the keys and reusable header objects
      • headers

        Components headers​(java.util.Map<java.lang.String,Header> headers)
        Sets this Components' headers property to the given Map containing keys and reusable header objects.
        Parameters:
        headers - a Map containing the keys and reusable header objects
        Returns:
        the current Components object
      • addHeader

        Components addHeader​(java.lang.String key,
                             Header header)
        Adds the given header to this Components' map of headers with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        header - a reusable header object
        Returns:
        the current Components object
      • getSecuritySchemes

        java.util.Map<java.lang.String,SecurityScheme> getSecuritySchemes​()
        Returns the securitySchemes property from a Components instance.
        Returns:
        a Map containing the keys and the reusable security schemes for this OpenAPI document
      • setSecuritySchemes

        void setSecuritySchemes​(java.util.Map<java.lang.String,SecurityScheme> securitySchemes)
        Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.
        Parameters:
        securitySchemes - a Map containing the keys and reusable security scheme objects
      • securitySchemes

        Components securitySchemes​(java.util.Map<java.lang.String,SecurityScheme> securitySchemes)
        Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.
        Parameters:
        securitySchemes - a Map containing the keys and reusable security scheme objects
        Returns:
        the current Components object
      • addSecurityScheme

        Components addSecurityScheme​(java.lang.String key,
                                     SecurityScheme securityScheme)
        Adds the given security scheme to this Components' map of security schemes with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        securityScheme - a reusable security scheme object
        Returns:
        the current Components object
      • getLinks

        java.util.Map<java.lang.String,Link> getLinks​()
        Returns the links property from a Components instance.
        Returns:
        a Map containing the keys and the reusable links for this OpenAPI document
      • setLinks

        void setLinks​(java.util.Map<java.lang.String,Link> links)
        Sets this Components' links property to the given Map containing keys and reusable link objects.
        Parameters:
        links - a Map containing the keys and reusable link objects
      • links

        Components links​(java.util.Map<java.lang.String,Link> links)
        Sets this Components' links property to the given Map containing keys and reusable link objects.
        Parameters:
        links - a Map containing the keys and reusable link objects
        Returns:
        the current Components object
      • addLink

        Components addLink​(java.lang.String key,
                           Link link)
        Adds the given link to this Components' map of links with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        link - a reusable link object
        Returns:
        the current Components object
      • getCallbacks

        java.util.Map<java.lang.String,Callback> getCallbacks​()
        Returns the callbacks property from a Components instance.
        Returns:
        a Map containing the keys and the reusable callbacks for this OpenAPI document
      • setCallbacks

        void setCallbacks​(java.util.Map<java.lang.String,Callback> callbacks)
        Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.
        Parameters:
        callbacks - a Map containing the keys and reusable callback objects
      • callbacks

        Components callbacks​(java.util.Map<java.lang.String,Callback> callbacks)
        Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.
        Parameters:
        callbacks - a Map containing the keys and reusable callback objects
        Returns:
        the current Components object
      • addCallback

        Components addCallback​(java.lang.String key,
                               Callback callback)
        Adds the given callback to this Components' map of callbacks with the given string as its key.
        Parameters:
        key - a key conforming to the format required for this object
        callback - a reusable callback object
        Returns:
        the current Components object