William Cheng d810d7c534
R echo client tests (#17629)
* add r echo api client sample

* add r workflow

* fix

* add env

* set r version

* install curl

* install dep

* fix

* comment out installation
2024-01-18 09:05:35 +08:00

6.3 KiB

R API client for openapi

Echo Server API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI spec from a remote server, you can easily generate an API client.

  • API version: 0.1.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RClientCodegen

Installation

Prerequisites

Install the dependencies

install.packages("jsonlite")
install.packages("httr")
install.packages("base64enc")

Build the package

git clone https://github.com/GIT_USER_ID/GIT_REPO_ID
cd GIT_REPO_ID
R CMD build .
R CMD check openapi_1.0.0.tar.gz --no-manual
R CMD INSTALL --preclean openapi_1.0.0.tar.gz

Install the package

install.packages("openapi")

To install directly from Github, use devtools:

install.packages("devtools")
library(devtools)
install_github("GIT_USER_ID/GIT_REPO_ID")

To install the package from a local file:

install.packages("openapi_1.0.0.tar.gz", repos = NULL, type = "source")

Usage

library(openapi)

Reformat code

To reformat code using styler, please run the following in the R console:

install.packages("remotes")
remotes::install_github("r-lib/styler@v1.7.0.9003")
library("styler")
style_dir()

Documentation for API Endpoints

All URIs are relative to http://localhost:3000

Class Method HTTP request Description
AuthApi TestAuthHttpBasic POST /auth/http/basic To test HTTP basic authentication
AuthApi TestAuthHttpBearer POST /auth/http/bearer To test HTTP bearer authentication
BodyApi TestBinaryGif POST /binary/gif Test binary (gif) response body
BodyApi TestBodyApplicationOctetstreamBinary POST /body/application/octetstream/binary Test body parameter(s)
BodyApi TestBodyMultipartFormdataArrayOfBinary POST /body/application/octetstream/array_of_binary Test array of binary in multipart mime
BodyApi TestBodyMultipartFormdataSingleBinary POST /body/application/octetstream/single_binary Test single binary in multipart mime
BodyApi TestEchoBodyAllOfPet POST /echo/body/allOf/Pet Test body parameter(s)
BodyApi TestEchoBodyFreeFormObjectResponseString POST /echo/body/FreeFormObject/response_string Test free form object
BodyApi TestEchoBodyPet POST /echo/body/Pet Test body parameter(s)
BodyApi TestEchoBodyPetResponseString POST /echo/body/Pet/response_string Test empty response body
BodyApi TestEchoBodyTagResponseString POST /echo/body/Tag/response_string Test empty json (request body)
FormApi TestFormIntegerBooleanString POST /form/integer/boolean/string Test form parameter(s)
FormApi TestFormOneof POST /form/oneof Test form parameter(s) for oneOf schema
HeaderApi TestHeaderIntegerBooleanStringEnums GET /header/integer/boolean/string/enums Test header parameter(s)
PathApi TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath GET /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} Test path parameter(s)
QueryApi TestEnumRefString GET /query/enum_ref_string Test query parameter(s)
QueryApi TestQueryDatetimeDateString GET /query/datetime/date/string Test query parameter(s)
QueryApi TestQueryIntegerBooleanString GET /query/integer/boolean/string Test query parameter(s)
QueryApi TestQueryStyleDeepObjectExplodeTrueObject GET /query/style_deepObject/explode_true/object Test query parameter(s)
QueryApi TestQueryStyleDeepObjectExplodeTrueObjectAllOf GET /query/style_deepObject/explode_true/object/allOf Test query parameter(s)
QueryApi TestQueryStyleFormExplodeTrueArrayString GET /query/style_form/explode_true/array_string Test query parameter(s)
QueryApi TestQueryStyleFormExplodeTrueObject GET /query/style_form/explode_true/object Test query parameter(s)
QueryApi TestQueryStyleFormExplodeTrueObjectAllOf GET /query/style_form/explode_true/object/allOf Test query parameter(s)

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

http_auth

  • Type: HTTP basic authentication

http_bearer_auth

  • Type: Bearer authentication

Author

team@openapitools.org