Hippolyte HENRY 81a5e44a6c
[ruby] Improve ruby client examples (#8040)
* [ruby] Improve ruby client examples

* samples

* quote fixes

* Keep enum value

* better string type handling

* fix failing tests

* add space after comment

* update samples

* use Time

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-16 00:10:04 +08:00

1.2 KiB

Petstore::DefaultApi

All URIs are relative to http://petstore.swagger.io:80/v2

Method HTTP request Description
foo_get GET /foo

foo_get

foo_get

Examples

require 'time'
require 'petstore'

api_instance = Petstore::DefaultApi.new

begin
  
  result = api_instance.foo_get
  p result
rescue Petstore::ApiError => e
  puts "Error when calling DefaultApi->foo_get: #{e}"
end

Using the foo_get_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> foo_get_with_http_info

begin
  
  data, status_code, headers = api_instance.foo_get_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <InlineResponseDefault>
rescue Petstore::ApiError => e
  puts "Error when calling DefaultApi->foo_get_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

InlineResponseDefault

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json