HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulestripeapi-3.0.0.0Haskell2010

StripeAPI.Common

This module serves the purpose of defining common functionality which remains the same across all OpenAPI specifications.

  • 9 types
  • 2 classes
  • 7 values
valuedoBodyCallWithConfiguration
  1. :: (MonadHTTP m, ToJSON body)
  2. => Configuration

    Configuration options like base URL and security scheme

  3. -> Text

    HTTP method (GET, POST, etc.)

  4. -> Text

    Path to append to the base URL (path parameters should already be replaced)

  5. -> [QueryParameter]

    Query parameters

  6. -> Maybe body

    Request body

  7. -> RequestBodyEncoding

    JSON or form data deepobjects

  8. -> m (Response ByteString)

    The raw response from the server

#

This is the main functionality of this module

It makes a concrete Call to a Server with a body

methodstringifyModel :: a -> String
#

Stringifies a showable value

Example1 expression
stringifyModel "Test""Test"
Example1 expression
stringifyModel 123"123"
datadata Configuration
#

An operation can and must be configured with data, which may be common for many operations.

This configuration consists of information about the server URL and the used security scheme.

In OpenAPI these information can be defined

  • Root level

  • Path level

  • Operation level

To get started, the defaultConfiguration can be used and changed accordingly.

Note that it is possible that bearerAuthenticationSecurityScheme is not available because it is not a security scheme in the OpenAPI specification.

defaultConfiguration
  { configSecurityScheme = bearerAuthenticationSecurityScheme "token" }

Constructors

Instances1MonadReader
typetype SecurityScheme = Request -> Request
#

This type specifies a security scheme which can modify a request according to the scheme (e. g. add an Authorization header)

classclass Show a => StringifyModel a where
#

This type class makes the code generation for URL parameters easier as it allows to stringify a value

The Show class is not sufficient as strings should not be stringified with quotes.

Instances3StringifyModel
newtypenewtype JsonByteString
#

Wraps a ByteString to implement ToJSON and FromJSON

Instances5Eq, Ord, Show, FromJSON, ToJSON
newtypenewtype ClientT (m :: Type -> Type) a
#

The monad in which the operations can be run. Contains the Configuration to run the requests with.

Run it with runWithConfiguration

Constructors

Instances7MonadTrans, MonadReader, Monad, Functor, Applicative, MonadIO, …