Title: | R 'API' Descriptions |
---|---|
Description: | Convert an 'API' description ('APID'), such as one that follows the 'OpenAPI Specification', to an R 'API' description object (a "rapid"). The rapid object follows the 'OpenAPI Specification' to make it easy to convert to and from 'API' documents. |
Authors: | Jon Harmon [aut, cre] , The Linux Foundation [cph] (OpenAPI Specification) |
Maintainer: | Jon Harmon <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9003 |
Built: | 2024-11-12 16:26:53 UTC |
Source: | https://github.com/jonthegeek/rapid |
as_api_key_security_scheme()
turns an existing object into an
api_key_security_scheme
. This is in contrast with
class_api_key_security_scheme()
, which builds an api_key_security_scheme
from individual properties.
as_api_key_security_scheme(x, ..., arg = caller_arg(x), call = caller_env())
as_api_key_security_scheme(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or be a list or character vector
with names "name" and either "in" or "location", or names that can be
coerced to those names via |
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
An api_key_security_scheme
as returned by
class_api_key_security_scheme()
.
security scheme objects
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
Convert an object into an object with a rapid-style class.
as_api_object( x, target_class, ..., alternate_names = NULL, arg = caller_arg(x), call = caller_env() )
as_api_object( x, target_class, ..., alternate_names = NULL, arg = caller_arg(x), call = caller_env() )
x |
The object to coerce. Must be empty, or be a named list or character
vector having names corresponding to the parameter of the |
target_class |
The S7 class to which the object should be converted. |
... |
These dots are for future extensions and must be empty. |
alternate_names |
Character vector (optional). An optional named
character vector, where the names are the names as they might appear in
|
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
An object with the specified target_class
.
rapid object
as_rapid()
,
class_rapid()
,
expand_servers()
as_components()
turns an existing object into a
components
object. This is in contrast with
class_components()
, which builds a components
from
individual properties.
as_components(x, ..., arg = caller_arg(x), call = caller_env())
as_components(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or be a list containing a single
list named "security_schemes", or a name that can be coerced to
"security_schemes" via |
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
A components
object as returned by
class_components()
.
class_components()
for creating components
objects.
components object
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_components() as_components(list( securitySchemes = list( accountAuth = list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ), profileAuth = list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ), resetPasswordAuth = list( `in` = "header", name = "authorization", type = "apiKey" ), verifyEmailAuth = list( `in` = "header", name = "authorization", type = "apiKey" ) ) ))
as_components() as_components(list( securitySchemes = list( accountAuth = list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ), profileAuth = list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ), resetPasswordAuth = list( `in` = "header", name = "authorization", type = "apiKey" ), verifyEmailAuth = list( `in` = "header", name = "authorization", type = "apiKey" ) ) ))
as_contact()
turns an existing object into a contact
. This is in contrast
with class_contact()
, which builds a contact
from individual properties.
as_contact(x, ..., arg = caller_arg(x), call = caller_env())
as_contact(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or have names "name", "email",
and/or "url", or names that can be coerced to those names via
|
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
A contact
as returned by class_contact()
.
info object
as_info()
,
as_license()
,
as_origin()
,
class_contact()
,
class_info()
,
class_license()
,
class_origin()
as_contact() as_contact(list(name = "Jon Harmon", email = "[email protected]"))
as_contact() as_contact(list(name = "Jon Harmon", email = "[email protected]"))
as_info()
turns an existing object into an info
object. This is in
contrast with class_info()
, which builds an info
from individual
properties.
as_info(x, ..., arg = caller_arg(x), call = caller_env())
as_info(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or have names "title",
"version", "contact", "description", "license", "summary",
"terms_of_service", and/or "origin" (or "x-origin", which will be coerced
to "origin"), or names that can be coerced to those names via
|
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
An info
object as returned by class_info()
.
info object
as_contact()
,
as_license()
,
as_origin()
,
class_contact()
,
class_info()
,
class_license()
,
class_origin()
as_info() as_info(list(title = "My Cool API", version = "1.0.0"))
as_info() as_info(list(title = "My Cool API", version = "1.0.0"))
as_license()
turns an existing object into a license
. This is in contrast
with class_license()
, which builds a license
from individual properties.
as_license(x, ..., arg = caller_arg(x), call = caller_env())
as_license(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or have names "name",
"identifier", and/or "url", or names that can be coerced to those names via
|
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
A license
as returned by class_license()
.
info object
as_contact()
,
as_info()
,
as_origin()
,
class_contact()
,
class_info()
,
class_license()
,
class_origin()
as_license() as_license(list(name = "Apache 2.0", identifier = "Apache-2.0"))
as_license() as_license(list(name = "Apache 2.0", identifier = "Apache-2.0"))
as_oauth2_authorization_code_flow()
turns an existing object into an
oauth2_authorization_code_flow
. This is in contrast with
class_oauth2_authorization_code_flow()
, which builds an
oauth2_authorization_code_flow
from individual properties.
as_oauth2_authorization_code_flow( x, ..., arg = caller_arg(x), call = caller_env() )
as_oauth2_authorization_code_flow( x, ..., arg = caller_arg(x), call = caller_env() )
x |
The object to coerce. Must be empty or be a list of named lists,
each with names "refresh_url", "scopes", "authorization_url", and/or
"token_url", or names that can be coerced to those names via
|
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
An oauth2_authorization_code_flow
as returned by
class_oauth2_authorization_code_flow()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_oauth2_implicit_flow()
turns an existing object into an
oauth2_implicit_flow
. This is in contrast with
class_oauth2_implicit_flow()
, which builds an oauth2_implicit_flow
from
individual properties.
as_oauth2_implicit_flow(x, ..., arg = caller_arg(x), call = caller_env())
as_oauth2_implicit_flow(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or be a list of named lists,
each with names "refresh_url", "scopes", and/or "authorization_url", or
names that can be coerced to those names via |
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
An oauth2_implicit_flow
as returned by
class_oauth2_implicit_flow()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_oauth2_security_scheme()
turns an existing object into an
oauth2_security_scheme
. This is in contrast with
class_oauth2_security_scheme()
, which builds an oauth2_security_scheme
from individual properties.
as_oauth2_security_scheme(x, ...)
as_oauth2_security_scheme(x, ...)
x |
The object to coerce. Must be empty or be a list with an object
named "flows" or a name that can be coerced to "flows" via
|
... |
These dots are for future extensions and must be empty. |
An oauth2_security_scheme
as returned by
class_oauth2_security_scheme()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_oauth2_token_flow()
turns an existing object into an
oauth2_token_flow
. This is in contrast with class_oauth2_token_flow()
,
which builds an oauth2_token_flow
from individual properties.
as_oauth2_token_flow(x, ..., arg = caller_arg(x), call = caller_env())
as_oauth2_token_flow(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or be a list of named lists,
each with names "refresh_url", "scopes", and/or "token_url", or names that
can be coerced to those names via |
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
An oauth2_token_flow
as returned by class_oauth2_token_flow()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_origin()
turns an existing object into an origin
. This is in contrast
with class_origin()
, which builds an origin
from individual properties.
as_origin(x, ..., arg = caller_arg(x), call = caller_env())
as_origin(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or have names "url", "format",
and/or "version", or names that can be coerced to those names via
|
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
An origin
as returned by class_origin()
.
info object
as_contact()
,
as_info()
,
as_license()
,
class_contact()
,
class_info()
,
class_license()
,
class_origin()
as_origin() as_origin( list( list( format = "openapi", url = "https://api.open.fec.gov/swagger/", version = "3.0" ) ) )
as_origin() as_origin( list( list( format = "openapi", url = "https://api.open.fec.gov/swagger/", version = "3.0" ) ) )
as_paths()
turns an existing object into a paths
object. This is in
contrast with class_paths()
, which builds a paths
object from individual
properties. In practice, class_paths()
and as_paths()
are currently
functionally identical. However, in the future, as_paths()
will coerce
other valid objects to the expected shape.
as_paths(x, ...)
as_paths(x, ...)
x |
The object to coerce. Must be empty or be a |
... |
These dots are for future extensions and must be empty. |
A paths
object as returned by class_paths()
.
paths object
class_paths()
as_paths() as_paths(mtcars)
as_paths() as_paths(mtcars)
as_rapid()
turns an existing object into a rapid
object. This is in
contrast with class_rapid()
, which builds a rapid
object from individual
properties.
as_rapid(x, ...)
as_rapid(x, ...)
x |
The object to coerce. Must be empty or have names "info", "servers",
"components", "paths", and/or "security", or names that can be coerced to
those names via |
... |
These dots are for future extensions and must be empty. |
A rapid
object as returned by class_rapid()
.
rapid object
as_api_object()
,
class_rapid()
,
expand_servers()
as_rapid()
as_rapid()
as_reference()
turns an existing object into a reference
. This is in
contrast with class_reference()
, which builds a reference
from individual
properties.
as_reference(x, ..., arg = caller_arg(x), call = caller_env())
as_reference(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or have names "type",
"nullable", "description", and/or "format", or names that can be coerced to
those names via |
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
A reference
as returned by class_reference()
.
reference objects
class_reference()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_reference() as_reference(list(`$ref` = "#/components/schemas/Pet"))
as_reference() as_reference(list(`$ref` = "#/components/schemas/Pet"))
as_schema()
turns an existing object into a schema
. This is in contrast
with class_schema()
, which builds a schema
from individual properties.
as_schema(x, ..., arg = caller_arg(x), call = caller_env())
as_schema(x, ..., arg = caller_arg(x), call = caller_env())
x |
The object to coerce. Must be empty or have names "type",
"nullable", "description", and/or "format", or names that can be coerced to
those names via |
... |
These dots are for future extensions and must be empty. |
arg |
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem. |
call |
The execution environment of a currently
running function, e.g. |
A schema
as returned by class_schema()
.
schema objects
class_schema()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_schema() as_schema( list( type = "string", format = "date-time", description = "Timestamp when the event will occur." ) )
as_schema() as_schema( list( type = "string", format = "date-time", description = "Timestamp when the event will occur." ) )
as_scopes()
turns an existing object into a scopes
. This is in contrast
with class_scopes()
, which builds a scopes
from individual properties.
as_scopes(x, ...)
as_scopes(x, ...)
x |
The object to coerce. Must be coercible to a named character vector. |
... |
These dots are for future extensions and must be empty. |
A scopes
as returned by class_scopes()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_security()
turns an existing object into a security
object. This is in
contrast with class_security()
, which builds a security
from individual
properties.
as_security(x, ...)
as_security(x, ...)
x |
The object to coerce. Must be empty or be a list containing a single
list named "security_schemes", or a name that can be coerced to
"security_schemes" via |
... |
These dots are for future extensions and must be empty. |
A security
object as returned by class_security()
.
security object
class_security()
as_security() as_security( list( list( oauth2 = c("user", "user:email", "user:follow") ), list(internalApiKey = list()) ) )
as_security() as_security( list( list( oauth2 = c("user", "user:email", "user:follow") ), list(internalApiKey = list()) ) )
as_security_scheme()
turns an existing object into a security_scheme
object. It uses the type
element of such objects to determine which type of
security scheme to construct.
as_security_scheme(x, ...)
as_security_scheme(x, ...)
x |
The object to coerce. Must be empty or be a named list, with at
least an element |
... |
These dots are for future extensions and must be empty. |
A security_scheme
object as returned by
class_api_key_security_scheme()
or class_oauth2_security_scheme()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_security_scheme( list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ) ) as_security_scheme( list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ) ) as_security_scheme( list( `in` = "header", name = "authorization", type = "apiKey" ) )
as_security_scheme( list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ) ) as_security_scheme( list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ) ) as_security_scheme( list( `in` = "header", name = "authorization", type = "apiKey" ) )
as_security_scheme_details()
turns an existing object into a
security_scheme_details
object. This is in contrast with
class_security_scheme_details()
, which builds a security_scheme_details
from individual properties.
as_security_scheme_details(x, ...)
as_security_scheme_details(x, ...)
x |
The object to coerce. Must be empty or be a named list, where each element describes a security scheme object. This object should describe the security schemes for a single API. |
... |
These dots are for future extensions and must be empty. |
A security_scheme_details
object as returned by
class_security_scheme_details()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_security_scheme_details() as_security_scheme_details( list( accountAuth = list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ), profileAuth = list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ), resetPasswordAuth = list( `in` = "header", name = "authorization", type = "apiKey" ), verifyEmailAuth = list( `in` = "header", name = "authorization", type = "apiKey" ) ) )
as_security_scheme_details() as_security_scheme_details( list( accountAuth = list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ), profileAuth = list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ), resetPasswordAuth = list( `in` = "header", name = "authorization", type = "apiKey" ), verifyEmailAuth = list( `in` = "header", name = "authorization", type = "apiKey" ) ) )
as_security_schemes()
turns an existing object into a security_schemes
object. This is in contrast with class_security_schemes()
, which builds a
security_schemes
from individual properties.
as_security_schemes(x, ...)
as_security_schemes(x, ...)
x |
The object to coerce. Must be empty or be a named list, where each element describes a security scheme object. This object should describe the security schemes for a single API. |
... |
These dots are for future extensions and must be empty. |
A security_schemes
object as returned by
class_security_schemes()
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
as_security_schemes() as_security_schemes( list( accountAuth = list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ), profileAuth = list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ), resetPasswordAuth = list( `in` = "header", name = "authorization", type = "apiKey" ), verifyEmailAuth = list( `in` = "header", name = "authorization", type = "apiKey" ) ) )
as_security_schemes() as_security_schemes( list( accountAuth = list( description = "Account JWT token", flows = list( password = list( scopes = list( Catalog = "Access all read-only content", Commerce = "Perform account-level transactions", Playback = "Allow playback of restricted content", Settings = "Modify account settings" ), tokenUrl = "/account/authorization" ) ), type = "oauth2" ), profileAuth = list( description = "Profile JWT token", flows = list( password = list( scopes = list( Catalog = "Modify profile preferences and activity" ), tokenUrl = "/account/profile/authorization" ) ), type = "oauth2" ), resetPasswordAuth = list( `in` = "header", name = "authorization", type = "apiKey" ), verifyEmailAuth = list( `in` = "header", name = "authorization", type = "apiKey" ) ) )
as_server_variables()
turns an existing object into a server_variables
object. This is in contrast with class_server_variables()
, which builds a
server_variables
object from individual properties.
as_server_variables(x, ...)
as_server_variables(x, ...)
x |
The object to coerce. Must be empty or be a list of objects that can
be coerced to |
... |
These dots are for future extensions and must be empty. |
A server_variables
object as returned by
class_server_variables()
.
servers object
as_servers()
,
as_string_replacements()
,
class_server_variables()
,
class_servers()
,
class_string_replacements()
as_server_variables() as_server_variables( list( list( username = c(default = "demo", description = "Name of the user.") ), list( username = c( default = "demo", description = "Name of the user." ), port = list( default = "8443", enum = c("8443", "443") ) ) ) )
as_server_variables() as_server_variables( list( list( username = c(default = "demo", description = "Name of the user.") ), list( username = c( default = "demo", description = "Name of the user." ), port = list( default = "8443", enum = c("8443", "443") ) ) ) )
as_servers()
turns an existing object into a servers
object. This is in
contrast with class_servers()
, which builds a servers
object from
individual properties.
as_servers(x, ...)
as_servers(x, ...)
x |
The object to coerce. Must be empty or have names "name", "email",
and/or "url", or names that can be coerced to those names via
|
... |
These dots are for future extensions and must be empty. |
A servers
object as returned by class_servers()
.
servers object
as_server_variables()
,
as_string_replacements()
,
class_server_variables()
,
class_servers()
,
class_string_replacements()
as_servers() as_servers( list( list( url = "https://development.gigantic-server.com/v1", description = "Development server" ), list( url = "https://staging.gigantic-server.com/v1", description = "Staging server" ), list( url = "https://api.gigantic-server.com/v1", description = "Production server" ) ) )
as_servers() as_servers( list( list( url = "https://development.gigantic-server.com/v1", description = "Development server" ), list( url = "https://staging.gigantic-server.com/v1", description = "Staging server" ), list( url = "https://api.gigantic-server.com/v1", description = "Production server" ) ) )
as_string_replacements()
turns an existing object into a
string_replacements
. This is in contrast with
class_string_replacements()
, which builds a string_replacements
from
individual properties.
as_string_replacements(x, ...)
as_string_replacements(x, ...)
x |
The object to coerce. Must be empty or be a list of named lists,
each with names "enum", "default", or "description", or names that can be
coerced to those names via |
... |
These dots are for future extensions and must be empty. |
A string_replacements
as returned by class_string_replacements()
.
servers object
as_server_variables()
,
as_servers()
,
class_server_variables()
,
class_servers()
,
class_string_replacements()
as_string_replacements() as_string_replacements( list( username = c( default = "demo", description = "Name of the user." ), port = list( default = "8443", enum = c("8443", "443") ) ) )
as_string_replacements() as_string_replacements( list( username = c( default = "demo", description = "Name of the user." ), port = list( default = "8443", enum = c("8443", "443") ) ) )
Defines an API key security scheme that can be used by the operations.
class_api_key_security_scheme( parameter_name = character(), location = c("query", "header", "cookie") )
class_api_key_security_scheme( parameter_name = character(), location = c("query", "header", "cookie") )
parameter_name |
Character vector (required). The names of the header, query or cookie parameters to be used. |
location |
Character vector (required). The location of the API key. Valid values are "query", "header" or "cookie". |
An api_key_security_scheme
S7 object, with fields parameter_name
and location
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_api_key_security_scheme( parameter_name = "Authorization", location = "header" )
class_api_key_security_scheme( parameter_name = "Authorization", location = "header" )
Holds a set of reusable objects for different aspects of the OAS. All objects
defined within the components object will have no effect on the API unless
they are explicitly referenced from properties outside the components object.
We currently only support the security_schemes object within the components
object (see class_security_schemes()
).
class_components(..., security_schemes = class_security_schemes())
class_components(..., security_schemes = class_security_schemes())
... |
These dots are for future extensions and must be empty. |
security_schemes |
An object to hold reusable security scheme objects
created by |
A components
S7 object with various schemas for the API.
as_components()
for coercing objects to
components
objects.
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_components() class_components( security_schemes = class_security_schemes( name = "a", details = class_security_scheme_details( class_api_key_security_scheme("parm", "query") ) ) )
class_components() class_components( security_schemes = class_security_schemes( name = "a", details = class_security_scheme_details( class_api_key_security_scheme("parm", "query") ) ) )
A contact
object provides contact information for the API.
class_contact(name = character(0), email = character(0), url = character(0))
class_contact(name = character(0), email = character(0), url = character(0))
name |
Character scalar (optional). The identifying name of the contact person or organization. |
email |
Character scalar (optional). The email address of the contact person/organization. This must be in the form of an email address. |
url |
Character scalar (optional). The URL pointing to the contact information. |
A contact
S7 object describing who to contact for information about
the API, with fields name
, email
, and url
.
info object
as_contact()
,
as_info()
,
as_license()
,
as_origin()
,
class_info()
,
class_license()
,
class_origin()
class_contact( "API Support", "[email protected]", "https://www.example.com/support" )
class_contact( "API Support", "[email protected]", "https://www.example.com/support" )
The object provides metadata about the API. The metadata may be used by the clients if needed, and may be presented in editing or documentation generation tools for convenience.
class_info( title = character(), version = character(), ..., contact = class_contact(), description = character(), license = class_license(), summary = character(), terms_of_service = character(), origin = class_origin() )
class_info( title = character(), version = character(), ..., contact = class_contact(), description = character(), license = class_license(), summary = character(), terms_of_service = character(), origin = class_origin() )
title |
Character scalar. The title of the API. Required when the object is not empty. |
version |
Character scalar. The version of the API description (which is distinct from the OpenAPI Specification version or the API implementation version). Required when the object is not empty. |
... |
These dots are for future extensions and must be empty. |
contact |
The contact information for the exposed API, generated via
|
description |
Character scalar (optional). A description of the API. CommonMark syntax may be used for rich text representation. |
license |
The license information for the exposed API, generated via
|
summary |
Character scalar (optional). A short summary of the API. |
terms_of_service |
Character scalar (optional). A URL to the Terms of Service for the API. |
origin |
The url and related information about the document used to build the API description. This is used to resolve relative paths in the API description. Note: This is not part of the OpenAPI Specification, but is sometimes supplied as "x-origin". |
An info
S7 object with metadata describing a single API.
info object
as_contact()
,
as_info()
,
as_license()
,
as_origin()
,
class_contact()
,
class_license()
,
class_origin()
class_info() class_info( title = "My Cool API", version = "1.0.2", license = class_license( name = "Apache 2.0", url = "https://opensource.org/license/apache-2-0/" ) ) class_info( title = "My Abbreviated API", version = "2.0.0", origin = "https://root.url" )
class_info() class_info( title = "My Cool API", version = "1.0.2", license = class_license( name = "Apache 2.0", url = "https://opensource.org/license/apache-2-0/" ) ) class_info( title = "My Abbreviated API", version = "2.0.0", origin = "https://root.url" )
A license
object provides license information for the API to describe how
the API can be used.
class_license( name = character(), ..., identifier = character(), url = character() )
class_license( name = character(), ..., identifier = character(), url = character() )
name |
Character scalar (optional). The license name used for the API. |
... |
These dots are for future extensions and must be empty. |
identifier |
Character scalar (optional). An
SPDX
license expression for the API. The |
url |
Character scalar (optional). A URL to the license used for the
API. This must be in the form of a URL. The |
A license
S7 object describing allowed usage of the API, with
fields name
, identifier
, and url
.
info object
as_contact()
,
as_info()
,
as_license()
,
as_origin()
,
class_contact()
,
class_info()
,
class_origin()
class_license( "Apache 2.0", identifier = "Apache-2.0" ) class_license( "Apache 2.0", url = "https://opensource.org/license/apache-2-0/" )
class_license( "Apache 2.0", identifier = "Apache-2.0" ) class_license( "Apache 2.0", url = "https://opensource.org/license/apache-2-0/" )
An oauth2_authorization_code_flow
object describes the configuration for
the OAuth Authorization Code flow. Previously called accessCode
in OpenAPI
2.0.
class_oauth2_authorization_code_flow( authorization_url = character(), token_url = character(), ..., refresh_url = character(), scopes = class_scopes() )
class_oauth2_authorization_code_flow( authorization_url = character(), token_url = character(), ..., refresh_url = character(), scopes = class_scopes() )
authorization_url |
Character vector (required). The authorization URL to be used for this flow. This must be in the form of a URL. The OAuth2 standard requires the use of TLS. |
token_url |
Character vector (required). The token URL to be used for this flow. This must be in the form of a URL. The OAuth2 standard requires the use of TLS. |
... |
These dots are for future extensions and must be empty. |
refresh_url |
Character scalar (optional). The URL to be used for obtaining refresh tokens. This must be in the form of a URL. The OAuth2 standard requires the use of TLS. |
scopes |
An optional |
An oauth2_authorization_code_flow
S7 object, with fields
authorization_url
, token_url
, refresh_url
, and scopes
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_oauth2_authorization_code_flow( authorization_url = "https://example.com/authorize", token_url = "https://example.com/token", refresh_url = "https://example.com/refresh", scopes = class_scopes( name = c("server:read", "server:write"), description = c("Read server settings", "Write server settings") ) )
class_oauth2_authorization_code_flow( authorization_url = "https://example.com/authorize", token_url = "https://example.com/token", refresh_url = "https://example.com/refresh", scopes = class_scopes( name = c("server:read", "server:write"), description = c("Read server settings", "Write server settings") ) )
An oauth2_implicit_flow
object describes the configuration for the OAuth
Implicit flow.
class_oauth2_implicit_flow( authorization_url = character(), ..., refresh_url = character(), scopes = class_scopes() )
class_oauth2_implicit_flow( authorization_url = character(), ..., refresh_url = character(), scopes = class_scopes() )
authorization_url |
Character vector (required). The authorization URL to be used for this flow. This must be in the form of a URL. The OAuth2 standard requires the use of TLS. |
... |
These dots are for future extensions and must be empty. |
refresh_url |
Character scalar (optional). The URL to be used for obtaining refresh tokens. This must be in the form of a URL. The OAuth2 standard requires the use of TLS. |
scopes |
An optional |
An oauth2_implicit_flow
S7 object, with fields authorization_url
,
refresh_url
, and scopes
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_oauth2_implicit_flow( authorization_url = "https://example.com/authorize", refresh_url = "https://example.com/refresh" )
class_oauth2_implicit_flow( authorization_url = "https://example.com/authorize", refresh_url = "https://example.com/refresh" )
Defines an OAuth2 security scheme that can be used by the operations.
class_oauth2_security_scheme( ..., implicit_flow = class_oauth2_implicit_flow(), password_flow = class_oauth2_token_flow(), client_credentials_flow = class_oauth2_token_flow(), authorization_code_flow = class_oauth2_authorization_code_flow() )
class_oauth2_security_scheme( ..., implicit_flow = class_oauth2_implicit_flow(), password_flow = class_oauth2_token_flow(), client_credentials_flow = class_oauth2_token_flow(), authorization_code_flow = class_oauth2_authorization_code_flow() )
... |
These dots are for future extensions and must be empty. |
implicit_flow |
An |
password_flow , client_credentials_flow
|
An |
authorization_code_flow |
An |
An oauth2_security_scheme
S7 object, with fields implicit_flow
,
password_flow
, client_credentials_flow
, and authorization_code_flow
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_oauth2_security_scheme() class_oauth2_security_scheme( password_flow = class_oauth2_token_flow(token_url = "/tokens/passwords") )
class_oauth2_security_scheme() class_oauth2_security_scheme( password_flow = class_oauth2_token_flow(token_url = "/tokens/passwords") )
An oauth2_token_flow
object describes the configuration for the OAuth
Resource Owner Password flow or the OAuth Client Credentials flow (previously
called application in OpenAPI 2.0).
class_oauth2_token_flow( token_url = character(), ..., refresh_url = character(), scopes = class_scopes() )
class_oauth2_token_flow( token_url = character(), ..., refresh_url = character(), scopes = class_scopes() )
token_url |
Character vector (required). The token URL to be used for this flow. This must be in the form of a URL. The OAuth2 standard requires the use of TLS. |
... |
These dots are for future extensions and must be empty. |
refresh_url |
Character scalar (optional). The URL to be used for obtaining refresh tokens. This must be in the form of a URL. The OAuth2 standard requires the use of TLS. |
scopes |
An optional |
An oauth2_token_flow
S7 object, with fields token_url
,
refresh_url
, and scopes
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_oauth2_token_flow( token_url = "https://example.com/token", refresh_url = "https://example.com/refresh", scopes = class_scopes( name = c("server:read", "server:write"), description = c("Read server settings", "Write server settings") ) )
class_oauth2_token_flow( token_url = "https://example.com/token", refresh_url = "https://example.com/refresh", scopes = class_scopes( name = c("server:read", "server:write"), description = c("Read server settings", "Write server settings") ) )
An origin
object provides information about the primary source document(s)
used to build an API.
class_origin( url = character(), ..., format = character(), version = character() )
class_origin( url = character(), ..., format = character(), version = character() )
url |
Character (required). The URL(s) where the document(s) can be found. |
... |
These dots are for future extensions and must be empty. |
format |
Character scalar (optional). The format of the document. Presently this will likely always be "openapi". |
version |
Character scalar (optional). The specification version
(relative to the |
An origin
S7 object describing where to find the API description,
with fields url
, format
, and version
.
info object
as_contact()
,
as_info()
,
as_license()
,
as_origin()
,
class_contact()
,
class_info()
,
class_license()
class_origin( "https://api.open.fec.gov/swagger/", format = "openapi", version = "3.0" )
class_origin( "https://api.open.fec.gov/swagger/", format = "openapi", version = "3.0" )
Holds the relative paths to the individual endpoints and their operations.
The path is appended to the URL from the class_servers()
object in order to
construct the full URL. The paths may be empty.
class_paths(...)
class_paths(...)
... |
A data.frame, or arguments to pass to |
A paths
S7 object with details about API endpoints.
paths object
as_paths()
class_paths() class_paths( tibble::tibble( endpoint = c("/endpoint1", "/endpoint2"), operations = list( tibble::tibble(operation_properties = 1:2), tibble::tibble(operation_properties = 3:5) ) ) )
class_paths() class_paths( tibble::tibble( endpoint = c("/endpoint1", "/endpoint2"), operations = list( tibble::tibble(operation_properties = 1:2), tibble::tibble(operation_properties = 3:5) ) ) )
An object that represents an API.
class_rapid( info = class_info(), ..., servers = class_servers(), components = class_components(), paths = class_paths(), security = class_security() )
class_rapid( info = class_info(), ..., servers = class_servers(), components = class_components(), paths = class_paths(), security = class_security() )
info |
An |
... |
These dots are for future extensions and must be empty. |
servers |
A |
components |
A |
paths |
A |
security |
A |
A rapid
S7 object, with properties info
, servers
, components
,
paths
, and security
.
rapid object
as_api_object()
,
as_rapid()
,
expand_servers()
class_rapid() class_rapid( info = class_info(title = "A", version = "1"), servers = class_servers( url = "https://development.gigantic-server.com/v1" ) ) class_rapid( info = class_info(title = "A", version = "1"), servers = class_servers( url = c( "https://development.gigantic-server.com/v1", "https://staging.gigantic-server.com/v1", "https://api.gigantic-server.com/v1" ), description = c( "Development server", "Staging server", "Production server" ) ), components = class_components( security_schemes = class_security_schemes( name = "a", details = class_security_scheme_details( class_api_key_security_scheme("parm", "query") ) ) ) )
class_rapid() class_rapid( info = class_info(title = "A", version = "1"), servers = class_servers( url = "https://development.gigantic-server.com/v1" ) ) class_rapid( info = class_info(title = "A", version = "1"), servers = class_servers( url = c( "https://development.gigantic-server.com/v1", "https://staging.gigantic-server.com/v1", "https://api.gigantic-server.com/v1" ), description = c( "Development server", "Staging server", "Production server" ) ), components = class_components( security_schemes = class_security_schemes( name = "a", details = class_security_scheme_details( class_api_key_security_scheme("parm", "query") ) ) ) )
The reference
object allows for reuse of components between different parts
of the API description. These objects are currently simple character
references, but may change structure in the future to automatically resolve
references.
class_reference( ref_uri = character(0), summary = character(0), description = character(0) )
class_reference( ref_uri = character(0), summary = character(0), description = character(0) )
ref_uri |
Character scalar. The reference identifier. This must be in the form of a URI. |
summary |
Character scalar (optional). A short summary which by default should override that of the referenced component. If the referenced object-type does not allow a summary field, then this field has no effect. |
description |
Character scalar (optional). A description which by default should override that of the referenced component. CommonMark syntax may be used for rich text representation. If the referenced object-type does not allow a description field, then this field has no effect. |
A reference
S7 object pointing (by name) to another part of the
rapid
object.
reference objects
as_reference()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_reference("#/components/schemas/Pet")
class_reference("#/components/schemas/Pet")
The schema
object allows the definition of input and output data types.
These types can be objects, but also primitives and arrays. This object is a
superset of the JSON Schema Specification Draft 2020-12.
class_schema( type = c("string", "number", "integer", "boolean", "array", "object"), ..., nullable = FALSE, description = character(), format = character() )
class_schema( type = c("string", "number", "integer", "boolean", "array", "object"), ..., nullable = FALSE, description = character(), format = character() )
type |
Factor (or coercible to factor). The type of object being defined. Currently must be one of "string", "number", "integer", "boolean", "array", or "object". |
... |
These dots are for future extensions and must be empty. |
nullable |
Logical scalar (default |
description |
Character scalar (optional). A description of the object defined by the schema. |
format |
Character scalar (optional). The format of the object. Essentially a sub-type. |
A schema
S7 object describing the data type, with fields type
,
nullable
, description
, and format
.
schema objects
as_schema()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_scopes()
,
class_security_scheme_details()
,
class_security_schemes()
class_schema("string") class_schema("string", nullable = TRUE, description = "A nullable string.")
class_schema("string") class_schema("string", nullable = TRUE, description = "A nullable string.")
The available scopes for an OAuth2 flow.
class_scopes(name = character(), description = character())
class_scopes(name = character(), description = character())
name |
Character vector (required). The name of the scope. |
description |
Character vector (required). A short description of the scope. |
A scopes
S7 object, with fields name
and description
.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_security_scheme_details()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_security_scheme_details()
,
class_security_schemes()
class_scopes( name = c( "https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.channel-memberships.creator", "https://www.googleapis.com/auth/youtube.force-ssl", "https://www.googleapis.com/auth/youtube.readonly", "https://www.googleapis.com/auth/youtube.upload", "https://www.googleapis.com/auth/youtubepartner", "https://www.googleapis.com/auth/youtubepartner-channel-audit" ), description = c( "Manage your YouTube account", "See a list of your current active channel members", "See, edit, and permanently delete your YouTube videos", "View your YouTube account", "Manage your YouTube videos", "View and manage your assets and associated content on YouTube", "View private information of your YouTube channel" ) )
class_scopes( name = c( "https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.channel-memberships.creator", "https://www.googleapis.com/auth/youtube.force-ssl", "https://www.googleapis.com/auth/youtube.readonly", "https://www.googleapis.com/auth/youtube.upload", "https://www.googleapis.com/auth/youtubepartner", "https://www.googleapis.com/auth/youtubepartner-channel-audit" ), description = c( "Manage your YouTube account", "See a list of your current active channel members", "See, edit, and permanently delete your YouTube videos", "View your YouTube account", "Manage your YouTube videos", "View and manage your assets and associated content on YouTube", "View private information of your YouTube channel" ) )
The object lists the required security schemes to execute an operation or operations.
class_security(name = character(), ..., required_scopes = list())
class_security(name = character(), ..., required_scopes = list())
name |
Character vector (required). The names must correspond to
security schemes declared in the |
... |
These dots are for future extensions and must be empty. |
required_scopes |
A list of character vectors, each of which describe
the scopes required for this security scheme. The vector corresponding to a
given |
A security
S7 object with references of security required for
operations.
security object
as_security()
class_security() class_security( name = c("oauth2", "internalApiKey"), required_scopes = list( c("user", "user:email", "user:follow"), character() ) )
class_security() class_security( name = c("oauth2", "internalApiKey"), required_scopes = list( c("user", "user:email", "user:follow"), character() ) )
The object provides a list of details of security schemes for the API. Each
element within the list is an abstract_security_scheme()
object.
class_security_scheme_details(...)
class_security_scheme_details(...)
... |
One or more |
A security_scheme_details
object, which is a validated list of
abstract_security_scheme()
objects.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_schemes()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_schemes()
class_security_scheme_details( class_oauth2_security_scheme( password_flow = class_oauth2_token_flow( token_url = "/account/authorization", scopes = class_scopes( name = c("Catalog", "Commerce", "Playback", "Settings"), description = c( "Access all read-only content", "Perform account-level transactions", "Allow playback of restricted content", "Modify account settings" ) ) ) ), class_oauth2_security_scheme( password_flow = class_oauth2_token_flow( token_url = "/account/profile/authorization", scopes = class_scopes( name = "Catalog", description = "Modify profile preferences and activity" ) ) ), class_api_key_security_scheme( parameter_name = "authorization", location = "header" ), class_api_key_security_scheme( parameter_name = "authorization", location = "header" ) )
class_security_scheme_details( class_oauth2_security_scheme( password_flow = class_oauth2_token_flow( token_url = "/account/authorization", scopes = class_scopes( name = c("Catalog", "Commerce", "Playback", "Settings"), description = c( "Access all read-only content", "Perform account-level transactions", "Allow playback of restricted content", "Modify account settings" ) ) ) ), class_oauth2_security_scheme( password_flow = class_oauth2_token_flow( token_url = "/account/profile/authorization", scopes = class_scopes( name = "Catalog", description = "Modify profile preferences and activity" ) ) ), class_api_key_security_scheme( parameter_name = "authorization", location = "header" ), class_api_key_security_scheme( parameter_name = "authorization", location = "header" ) )
The object provides reusable security schemes for the API. These schemes may
be referenced by name in the top-level security
object or within paths
objects.
class_security_schemes( name = character(), details = class_security_scheme_details(), ..., description = character() )
class_security_schemes( name = character(), details = class_security_scheme_details(), ..., description = character() )
name |
Character vector (required). Names by which security schemes will be referenced. |
details |
The details of each security scheme, as a
|
... |
These dots are for future extensions and must be empty. |
description |
Character vector (optional). A short description for the security schemes. CommonMark syntax may be used for rich text representation. |
A security_schemes
S7 object with details about security available
for operations.
security scheme objects
as_api_key_security_scheme()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_scopes()
,
class_security_scheme_details()
components object
as_api_key_security_scheme()
,
as_components()
,
as_oauth2_authorization_code_flow()
,
as_oauth2_implicit_flow()
,
as_oauth2_security_scheme()
,
as_oauth2_token_flow()
,
as_reference()
,
as_schema()
,
as_scopes()
,
as_security_scheme()
,
as_security_scheme_details()
,
as_security_schemes()
,
class_api_key_security_scheme()
,
class_components()
,
class_oauth2_authorization_code_flow()
,
class_oauth2_implicit_flow()
,
class_oauth2_security_scheme()
,
class_oauth2_token_flow()
,
class_reference()
,
class_schema()
,
class_scopes()
,
class_security_scheme_details()
class_security_schemes() class_security_schemes( name = c( "accountAuth", "resetPasswordAuth" ), details = class_security_scheme_details( class_oauth2_security_scheme( password_flow = class_oauth2_token_flow( token_url = "/account/authorization", scopes = class_scopes( name = c("Catalog", "Commerce", "Playback", "Settings"), description = c( "Access all read-only content", "Perform account-level transactions", "Allow playback of restricted content", "Modify account settings" ) ) ) ), class_api_key_security_scheme( parameter_name = "authorization", location = "header" ) ) )
class_security_schemes() class_security_schemes( name = c( "accountAuth", "resetPasswordAuth" ), details = class_security_scheme_details( class_oauth2_security_scheme( password_flow = class_oauth2_token_flow( token_url = "/account/authorization", scopes = class_scopes( name = c("Catalog", "Commerce", "Playback", "Settings"), description = c( "Access all read-only content", "Perform account-level transactions", "Allow playback of restricted content", "Modify account settings" ) ) ) ), class_api_key_security_scheme( parameter_name = "authorization", location = "header" ) ) )
A list of string replacements objects, each of which is constructed with
class_string_replacements()
.
class_server_variables(...)
class_server_variables(...)
... |
One or more |
A server_variables
S7 object, which is a validated list of
class_string_replacements()
objects.
servers object
as_server_variables()
,
as_servers()
,
as_string_replacements()
,
class_servers()
,
class_string_replacements()
class_server_variables( list(class_string_replacements(), class_string_replacements()) )
class_server_variables( list(class_string_replacements(), class_string_replacements()) )
The object provides connectivity information for the API. The described servers are intended to be used as the base urls for calls to the API.
class_servers( url = character(), description = character(), variables = class_server_variables() )
class_servers( url = character(), description = character(), variables = class_server_variables() )
url |
Character vector (required). The urls of the target hosts. These
urls support |
description |
Character vector (optional). Strings describing the hosts
designated by |
variables |
A |
A servers
S7 object, with properties url
, description
, and
variables
.
servers object
as_server_variables()
,
as_servers()
,
as_string_replacements()
,
class_server_variables()
,
class_string_replacements()
class_servers( url = c( "https://development.gigantic-server.com/v1", "https://staging.gigantic-server.com/v1", "https://api.gigantic-server.com/v1" ), description = c( "Development server", "Staging server", "Production server" ) ) class_servers( url = "https://{username}.gigantic-server.com:{port}/{basePath}", description = "The production API server", variables = class_server_variables(class_string_replacements( name = c("username", "port", "basePath"), default = c("demo", "8443", "v2"), description = c( "The active user's folder.", NA, NA ), enum = list( NULL, c("8443", "443"), NULL ) )) )
class_servers( url = c( "https://development.gigantic-server.com/v1", "https://staging.gigantic-server.com/v1", "https://api.gigantic-server.com/v1" ), description = c( "Development server", "Staging server", "Production server" ) ) class_servers( url = "https://{username}.gigantic-server.com:{port}/{basePath}", description = "The production API server", variables = class_server_variables(class_string_replacements( name = c("username", "port", "basePath"), default = c("demo", "8443", "v2"), description = c( "The active user's folder.", NA, NA ), enum = list( NULL, c("8443", "443"), NULL ) )) )
A string_replacements
object describes server variable properties used for
substitution in a single server’s URL template.
class_string_replacements( name = character(), default = character(), ..., enum = list(), description = character() )
class_string_replacements( name = character(), default = character(), ..., enum = list(), description = character() )
name |
Character vector (required). The names of the variables. |
default |
Character vector (required). The default value to use for
substitution of each variable, which shall be sent if an alternate value is
not supplied. Note this behavior is different than the Schema Object’s
treatment of default values, because in those cases parameter values are
optional. If the |
... |
These dots are for future extensions and must be empty. |
enum |
List of (potentially empty) character vectors (optional). An enumeration of valid string values to be used if the substitution options are from a limited set. |
description |
Character vector (optional). An optional description for each server variable. CommonMark syntax may be used for rich text representation. |
A string_replacements
S7 object describing a collection of string
variables for a single server, with fields name
, default
, enum
, and
description
.
servers object
as_server_variables()
,
as_servers()
,
as_string_replacements()
,
class_server_variables()
,
class_servers()
class_string_replacements( "username", "demo", enum = c("demo", "other"), description = "The active user's folder." )
class_string_replacements( "username", "demo", enum = c("demo", "other"), description = "The active user's folder." )
expand_servers()
uses the origin
property of a rapid
object to expand
the servers
url
property to an absolute path.
expand_servers(x, ...)
expand_servers(x, ...)
x |
The object to update. Must be a |
... |
These dots are for future extensions and must be empty. |
A rapid
object as returned by class_rapid()
, with absolute server
paths.
rapid object
as_api_object()
,
as_rapid()
,
class_rapid()