Skip to content

Commit c512fce

Browse files
committed
integrate rapidoc
1 parent f592439 commit c512fce

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

R/Plumber.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Plumber <- R6Class(
4040
#' @param host A string overriding the default host
4141
#' @param port An port number overriding the default port
4242
#' @param doc_type The type of API documentation to generate. Can be either
43-
#' `"redoc"` (the default), `"swagger"`, or `NULL` (equating to not
44-
#' generating API docs)
43+
#' `"rapidoc"` (the default), `"redoc"`, `"swagger"`, or `NULL` (equating to
44+
#' not generating API docs)
4545
#' @param doc_path The URL path to serve the api documentation from
4646
#' @param reject_missing_methods Should requests to paths that doesn't
4747
#' have a handler for the specific method automatically be rejected with a
@@ -85,7 +85,7 @@ Plumber <- R6Class(
8585
super$initialize(host, port)
8686

8787
if (!is.null(doc_type)) {
88-
private$DOC_TYPE <- arg_match0(doc_type, c("swagger", "redoc"))
88+
private$DOC_TYPE <- arg_match0(doc_type, c("rapidoc", "redoc", "swagger"))
8989
}
9090
check_string(doc_path)
9191
private$DOC_PATH <- doc_path
@@ -384,12 +384,12 @@ Plumber <- R6Class(
384384
private$HEADER_ROUTER
385385
},
386386
#' @field doc_type The type of API documentation to generate. Can be either
387-
#' `"redoc"` (the default), `"swagger"`, or `NULL` (equating to not
388-
#' generating API docs)
387+
#' `"rapidoc"` (the default), `"redoc"`, `"swagger"`, or `NULL` (equating to
388+
#' not generating API docs)
389389
doc_type = function(value) {
390390
if (missing(value)) return(private$DOC_TYPE)
391391
if (!is.null(value)) {
392-
value <- arg_match0(value, c("swagger", "redoc"))
392+
value <- arg_match0(value, c("rapidoc", "redoc", "swagger"))
393393
}
394394
private$DOC_TYPE <- value
395395
},

R/api.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' listened on. Note that on most Unix-like systems including Linux and macOS,
1313
#' port numbers smaller than 1024 require root privileges.
1414
#' @param doc_type The type of API documentation to generate. Can be either
15-
#' `"redoc"` (the default), `"swagger"`, or `NULL` (equating to not
15+
#' `"rapidoc"` (the default), `"redoc"`, `"swagger"`, or `NULL` (equating to not
1616
#' generating API docs)
1717
#' @param doc_path The URL path to serve the api documentation from
1818
#' @param reject_missing_methods Should requests to paths that doesn't
@@ -53,7 +53,7 @@ api <- function(
5353
...,
5454
host = get_opts("host", "127.0.0.1"),
5555
port = get_opts("port", 8080),
56-
doc_type = get_opts("docs", "redoc"),
56+
doc_type = get_opts("docs", "rapidoc"),
5757
doc_path = get_opts("apiPath", "__docs__"),
5858
reject_missing_methods = get_opts("methodNotAllowed", FALSE),
5959
ignore_trailing_slash = get_opts("trailingSlash"),

R/api_docs.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#' The [OpenAPI standard](https://www.openapis.org) offers a way to describe the
44
#' various endpoints of your api in machine- and human-readable way. On top of
55
#' this, various solutions have been build to generate online documentation of
6-
#' the API based on a provided OpenAPI spec. plumber2 offers both support for
7-
#' [Redoc](https://redocly.com/redoc) or [Swagger](https://swagger.io) as a UI
8-
#' frontend for the documentation and will also generate the spec for you based
9-
#' on the tags in parsed files. If you are creating your API programmatically
10-
#' or you wish to add to the autogenerated docs you can add docs manually,
11-
#' either when adding a handler (using the `doc` argument), or with the
12-
#' `api_doc_add()` function
6+
#' the API based on a provided OpenAPI spec. plumber2 offers support for
7+
#' [RapiDoc](https://rapidocweb.com), [Redoc](https://redocly.com/redoc), and
8+
#' [Swagger](https://swagger.io) as a UI frontend for the documentation and will
9+
#' also generate the spec for you based on the tags in parsed files. If you are
10+
#' creating your API programmatically or you wish to add to the autogenerated
11+
#' docs you can add docs manually, either when adding a handler (using the `doc`
12+
#' argument), or with the `api_doc_add()` function
1313
#'
1414
#' @param api A plumber2 api object to add docs or doc settings to
1515
#' @inheritParams api

man/Plumber.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/api.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/api_docs.Rd

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)