forked from loafle/openapi-generator-original
* [R] fix namespace, use 2-space indentation (#2105)
* fix namespace, indentation
* use 2-space indentation in model files
* update gitignore
* use PascalCase for function naming (#2106)
* [R] improve .travis.yml, .Rbuildignore (#2109)
* update travis
* enhance travis.yml
* update travis, .Rbuildignore
* [R] Add auto-generated documentations, change parameter naming (#2114)
* add auto-generated doc for r client
* remove module name
* replace nil with void
* [R] fix object serialization to JSON (#2129)
* fix object serialization
* fix array property seriziation
* fix deserializing array of string
* fix array of object deserialization
* [R] Fix return type (#2140)
* fix return type
* update r petstore sample
* add auto-generated tests (#2141)
* rename file to conform to style guide (#2142)
* add authenticaiton support to R (#2153)
[R] Add authentication support, minor ApiClient refactor
* rename test files
* [R] various improvements and bug fixes (#2162)
* fix api keys in headers
* use optional parameter in function signature
* fix property naming
* fix doc assignment operator
* [R] fix base64 encode (#2171)
* fix base64 encode
* fix basic http auth
* fix typo, update instruction (#2203)
* rename test files to conform to style guide (#2206)
* [R] improve class constructor (#2208)
* update constructor with optional parameter, default value
* update r petstore sample
* clean up files
* regenerate files
* Revert "rename test files to conform to style guide (#2206)"
This reverts commit 90a6302a65.
* fix query parameter in api client (#2214)
R API client for petstore
This is a sample server Petstore server. For this sample, you can use the api key special-key to test the authorization filters.
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: 1.0.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("caTools")
Build the package
git clone https://github.com/GIT_USER_ID/GIT_REPO_ID
cd GIT_REPO_ID
R CMD build .
R CMD check petstore_1.0.0.tar.gz
R CMD INSTALL petstore_1.0.0.tar.gz
Install the package
install.packages("petstore")
To install directly from Github, use devtools:
install.packages("devtools")
library(devtools)
install_github("GIT_USER_ID/GIT_REPO_ID")
Usage
library(petstore)
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io/v2
| Class | Method | HTTP request | Description |
|---|---|---|---|
| PetApi | AddPet | POST /pet | Add a new pet to the store |
| PetApi | DeletePet | DELETE /pet/{petId} | Deletes a pet |
| PetApi | FindPetsByStatus | GET /pet/findByStatus | Finds Pets by status |
| PetApi | FindPetsByTags | GET /pet/findByTags | Finds Pets by tags |
| PetApi | GetPetById | GET /pet/{petId} | Find pet by ID |
| PetApi | UpdatePet | PUT /pet | Update an existing pet |
| PetApi | UpdatePetWithForm | POST /pet/{petId} | Updates a pet in the store with form data |
| PetApi | UploadFile | POST /pet/{petId}/uploadImage | uploads an image |
| StoreApi | DeleteOrder | DELETE /store/order/{orderId} | Delete purchase order by ID |
| StoreApi | GetInventory | GET /store/inventory | Returns pet inventories by status |
| StoreApi | GetOrderById | GET /store/order/{orderId} | Find purchase order by ID |
| StoreApi | PlaceOrder | POST /store/order | Place an order for a pet |
| UserApi | CreateUser | POST /user | Create user |
| UserApi | CreateUsersWithArrayInput | POST /user/createWithArray | Creates list of users with given input array |
| UserApi | CreateUsersWithListInput | POST /user/createWithList | Creates list of users with given input array |
| UserApi | DeleteUser | DELETE /user/{username} | Delete user |
| UserApi | GetUserByName | GET /user/{username} | Get user by user name |
| UserApi | LoginUser | GET /user/login | Logs user into the system |
| UserApi | LogoutUser | GET /user/logout | Logs out current logged in user session |
| UserApi | UpdateUser | PUT /user/{username} | Updated user |
Documentation for Models
Documentation for Authorization
api_key
- Type: API key
- API key parameter name: api_key
- Location: HTTP header
petstore_auth
- Type: OAuth
- Flow: implicit
- Authorization URL: http://petstore.swagger.io/api/oauth/dialog
- Scopes:
- write:pets: modify pets in your account
- read:pets: read your pets