Class: Yori::Schema::V3::RequestBody

Inherits:
Yori::SchemaBase show all
Defined in:
lib/yori/schema/v3/request_body.rb

Overview

RequestBody: Describes a single request body.

Instance Attribute Summary

Attributes inherited from Yori::SchemaBase

#id

Instance Method Summary collapse

Methods inherited from Yori::SchemaBase

eval_class!, eval_hash!, eval_input!, #ref, #validator

Instance Method Details

#contentObject

REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*



19
# File 'lib/yori/schema/v3/request_body.rb', line 19

hash_field_block :content, :content_type, Yori::Schema::V3::MediaType

#descriptionObject

A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.



15
# File 'lib/yori/schema/v3/request_body.rb', line 15

fields :description, :required

#requiredObject

Determines if the request body is required in the request. Defaults to false.



15
# File 'lib/yori/schema/v3/request_body.rb', line 15

fields :description, :required

#validate!Object



21
22
23
# File 'lib/yori/schema/v3/request_body.rb', line 21

def validate!
  validate_require_fields!('content')
end