path parameters as a zod object
query parameters as a zod object
response body as a zod type
which context to place this route in, see globalContext
express router
path the route happens, same format as used in express but avoid features not supported in openapi (e.g. advanced path matchers)
zod schemas of the parts of the request and response, use
emptyFormat to fill in default values
route handler
Optionaldocs: { description?: string; summary?: string }
information that should end up in the openapi spec
Optionaldescription?: stringa longer explanation, commonmark accepted
Optionalsummary?: stringa short description of what is route does, becomes the title
the handler function that got passed to router.get internally,
to be used in testing
Wrapper around router.get with built in validation and schema recording
The
reqandresobjects aren't provided to the passed in handler, if you're doing something more complicated (e.g. using headers) just use the router directly for now, the functionality needed could be incorporated in the future.