mirror of
https://github.com/acaloiaro/kombo-ruby-sdk
synced 2026-07-21 10:12:21 +00:00
861 B
861 B
Kombo::Schema4
Class instance methods
openapi_one_of
Returns the list of classes defined in oneOf.
Example
require 'kombo_client'
Kombo::Schema4.openapi_one_of
# =>
# [
# :'Array<Schema4>',
# :'Boolean',
# :'Float',
# :'Hash<String, Schema4>',
# :'String'
# ]
build
Find the appropriate object from the openapi_one_of list and casts the data into it.
Example
require 'kombo_client'
Kombo::Schema4.build(data)
# => #<Array<Schema4>:0x00007fdd4aab02a0>
Kombo::Schema4.build(data_that_doesnt_match)
# => nil
Parameters
| Name | Type | Description |
|---|---|---|
| data | Mixed | data to be matched against the list of oneOf items |
Return type
Array<Schema4>BooleanFloatHash<String, Schema4>Stringnil(if no type matches)