Skip to contents

This route facilitates serving the OpenAPI specs for your server, using either RapiDoc, Redoc or Swagger as a UI for it. This function does not help you describe your API - you have to provide the description for it yourself.

Usage

openapi_route(
  spec,
  root = "__docs__",
  ui = c("rapidoc", "redoc", "swagger"),
  ...
)

Arguments

spec

The path to the json or yaml file describing your OpenAPI spec

root

The point from which you want to serve your UI from

ui

Either "rapidoc", "redoc" or "swagger", setting which UI to use

...

Further arguments passed on to the ui functions (e.g. rapidoc::rapidoc_spec())

Value

A Route object

See also

Other Route constructors: asset_route(), ressource_route(), shared_secret_route(), sizelimit_route()