Papupata Documentation

API Reference

Primary functionality

These exported entities can be accessed directly from the main papupata library.

APIDeclaration

This class is the where almost everything happens, it is used for declaring, implementing and calling APIs.

Reference

Methods on the API declaration can be used to create PartiallyDeclaredAPIs, which in turn become DeclaredAPIs

convertExpressMiddleware

This function converts express middleware to papupata middleware.

Reference

skipHandlingRoute

This special value allows for having express continue routing.

Reference

handleUndefinedResponsesMiddleware

This middleware changes how undefined API responses values are handled.

Reference

Secondary functionality

These exported entities are considered support functionality can be imported from their own files.

Reference

fetchAdapter

This adapter allows you to call the APIs using global fetch as the means for doing so.

Reference

requestPromiseAdapter

This adapter allows you to call the APIs using global request promsie as the means for doing so.

Reference

supertestAdapter

This adapter allows you to call the APIs using supertest

Reference

supertestAdapter

This adapter allows you to call the APIs using supertest

Reference

supertestInvoker

This adapter allows you to call the APIs using supertest while giving you access to the supertest request for making assertions.

Reference

invokeImplementationAdapter

This adapter allows you to call the APIs without actually running an express server, primarily in tests.

Reference

testInvoker

This function allows you to call the APIs without actually running an express server, primarily in tests.

Reference