mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[ruby] document the *_with_http_info methods (#8094)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
|
||||
## Code Sample
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'petstore'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
|
||||
## Code Sample
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'petstore'
|
||||
|
||||
@@ -16,10 +16,9 @@ Use alias to array
|
||||
|
||||
Use alias to array
|
||||
|
||||
### Example
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
|
||||
api_instance = Petstore::UsageApi.new
|
||||
@@ -28,11 +27,29 @@ opts = {
|
||||
}
|
||||
|
||||
begin
|
||||
#Use alias to array
|
||||
# Use alias to array
|
||||
result = api_instance.array(opts)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling UsageApi->array: #{e}"
|
||||
puts "Error when calling UsageApi->array: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the array_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(Object, Integer, Hash)> array_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Use alias to array
|
||||
data, status_code, headers = api_instance.array_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => Object
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Error when calling UsageApi->array_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
@@ -64,10 +81,9 @@ Use alias to map
|
||||
|
||||
Use alias to map
|
||||
|
||||
### Example
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'petstore'
|
||||
|
||||
api_instance = Petstore::UsageApi.new
|
||||
@@ -76,11 +92,29 @@ opts = {
|
||||
}
|
||||
|
||||
begin
|
||||
#Use alias to map
|
||||
# Use alias to map
|
||||
result = api_instance.map(opts)
|
||||
p result
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Exception when calling UsageApi->map: #{e}"
|
||||
puts "Error when calling UsageApi->map: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the map_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(Object, Integer, Hash)> map_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Use alias to map
|
||||
data, status_code, headers = api_instance.map_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => Object
|
||||
rescue Petstore::ApiError => e
|
||||
puts "Error when calling UsageApi->map_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user