Papupata Documentation
Table of contents
What is papupata?
Getting started
Concepts and terms
>
Guides
>
Declaring APIs
Basics
Types for path and query
Query-based variants
Accessing metadata
Sharing APIs declarations
>
Clients
Setting up papupata
Calling APIs
Custom request adapters
Testing
>
Servers
Setting up papupata
Implementing APIs
Interacting with express
Middleware
Testing
Migrating to papupata 2.x
>
API Reference
>
class APIDeclaration
configure()
declareDeleteAPI()
declareGetAPI()
declarePostAPI()
declarePatchAPI()
declarePutAPI()
getConfig()
unmockAll()
updateConfig()
>
PartiallyDeclaredAPI
params()
query()
optionalQuery()
queryBool
()
body()
response()
TypeMapping
>
DeclaredAPI
invoke()
getURL()
implement()
implementation
implementationMiddleware
implementWithMiddleware()
implementWithExpressMiddleware()
implementWithPapupataMiddleware()
mock()
mockOnce()
unmock()
method
apiDeclaration
apiUrlParameters
path
ResponseType
ServerResponseType
BodyType
CallArgsType
RequestType
convertExpressMiddleware
skipHandlingRoute
handleUndefinedResponsesMiddleware
fetchAdapter
requestPromiseAdapter
supertestAdapter
supertestInvoker
invokeImplementationAdapter
testInvoker
>
Experimental
Conversion from OpenAPI
API Reference
class APIDeclaration
method getConfig
Purpose
Retrieves current papupata configuration
Usage
This method can be used to figure out what the current configuration is, typically so that is can be restored after modifying it for tests.
Returns
Configuration as set in the
configure
and
updateConfig
methods of the API configuration.