Class: DryOpenApi::RequestBody
- Inherits:
-
Object
- Object
- DryOpenApi::RequestBody
- Extended by:
- Dry::Initializer
- Includes:
- EquatableAsContent
- Defined in:
- lib/dry_open_api/request_body.rb
Class Method Summary collapse
Methods included from EquatableAsContent
Class Method Details
.load(hash) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/dry_open_api/request_body.rb', line 12 def self.load(hash) return unless hash new( description: hash['description'], content: hash['content'].map { |k, v| [k, MediaType.load(v)] }.to_h, required: hash['required'].present? ) end |