# Serve the docs from a different path
api() |>
api_doc_setting(doc_path = "__man__")
# Add documentation to the api programmatically
api() |>
api_doc_add(openapi(
info = openapi_info(
title = "My awesome api",
version = "1.0.0"
)
))
# Add documentation to a subset of the docs
api() |>
api_doc_add(
openapi_operation(
summary = "Get the current date",
responses = list(
"200" = openapi_response(
description = "Current Date",
content = openapi_content(
"text/plain" = openapi_schema(character())
)
)
)
),
subset = c("paths", "/date", "get")
)
Run the code above in your browser using DataLab