Interface CrestApplication


  • public interface CrestApplication
    Declare a CREST Application. This interface binds together the CREST ConnectionFactory that will be used to connect to the API, and the API ID and Version that will be used when describing it.
    • Method Detail

      • getConnectionFactory

        ConnectionFactory getConnectionFactory()
        Get the connection factory for the application.
        Returns:
        The factory.
      • getApiId

        String getApiId()
        Get the API ID, that will be used in the ApiDescription.
        Returns:
        The ID.
      • getApiVersion

        String getApiVersion()
        Get the API Version, that will be used in the ApiDescription.
        Returns:
        The Version.
      • allowMultiPartJsonRequests

        default boolean allowMultiPartJsonRequests()
        Whether the JSON content for a request can be sent in a mulipart/form-data payload. If this is enabled then CREST will look for the first part with a application/json content-type in the multipart body and use that as the request body.

        SECURITY WARNING: You MUST ensure that adequate CSRF defenses are in place if enabling this option and using cookie-based authentication for web browser clients. Multipart requests are allowed cross-origin with no restrictions by web browsers and do not trigger same-origin or CORS protections.

        Returns:
        whether to allow JSON requests to be sent inside a multipart form-data envelope.