openapi-generator/samples/client/petstore-security-test/ruby
Jérémie Bresson 7ecd5f3566
Rename "swagger" to "openapi" (#191)
* Rename ".swagger-codegen-ignore" to ".openapi-generator-ignore"
* Rename setGenerateSwaggerMetadata(Boolean) to setGenerateMetadata(Boolean)
* Rename Metadata Folder to .openapi-generator
2018-04-22 21:28:17 +02:00
..
.openapi-generator Rename "swagger" to "openapi" (#191) 2018-04-22 21:28:17 +02:00
docs fix defeault rspec test for ruby, update security petstore 2016-07-14 18:22:01 +08:00
lib update all petstore security samples 2017-10-18 10:10:44 +08:00
spec Fix typo in Ruby examples/mustache files (#5773) 2017-06-05 11:19:29 +08:00
.gitignore Update security samples for Ruby-Client. (#5287) 2017-04-04 14:41:22 +08:00
.openapi-generator-ignore Rename "swagger" to "openapi" (#191) 2018-04-22 21:28:17 +02:00
.rspec better code injection handling for ruby 2016-06-28 17:36:00 +08:00
Gemfile Update security samples for Ruby-Client. (#5287) 2017-04-04 14:41:22 +08:00
git_push.sh Update security samples for Ruby-Client. (#5287) 2017-04-04 14:41:22 +08:00
LICENSE better code injection handling for ruby 2016-06-28 17:36:00 +08:00
petstore.gemspec Correct minor typo in Ruby gemspec files (#7263) 2018-01-07 11:41:14 +08:00
Rakefile Update security samples for Ruby-Client. (#5287) 2017-04-04 14:41:22 +08:00
README.md Update security samples for Ruby-Client. (#5287) 2017-04-04 14:41:22 +08:00

petstore

Petstore - the Ruby gem for the Swagger Petstore */ ' " =_end -- \r\n \n \r

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \ */ ' " =_end --

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0 */ ' " =_end -- \r\n \n \r
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build petstore.gemspec

Then either install the gem locally:

gem install ./petstore-1.0.0.gem

(for development, run gem install --dev ./petstore-1.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'petstore', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'petstore'

api_instance = Petstore::FakeApi.new

opts = { 
  test_code_inject____end____rn_n_r: "test_code_inject____end____rn_n_r_example" # String | To test code injection */ ' \" =_end -- \\r\\n \\n \\r
}

begin
  #To test code injection */ ' \" =_end -- \\r\\n \\n \\r
  api_instance.test_code_inject____end__rn_n_r(opts)
rescue Petstore::ApiError => e
  puts "Exception when calling FakeApi->test_code_inject____end__rn_n_r: #{e}"
end

Documentation for API Endpoints

All URIs are relative to *https://petstore.swagger.io */ ' " =_end -- \r\n \n \r/v2 / ' " =_end -- \r\n \n \r

Class Method HTTP request Description
Petstore::FakeApi test_code_inject____end__rn_n_r PUT /fake To test code injection */ ' " =_end -- \r\n \n \r

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: api_key */ ' " =end -- \r\n \n \r
  • 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 */ ' " =_end -- \r\n \n \r
    • read:pets: read your pets */ ' " =_end -- \r\n \n \r