Class: Yori::Schema::V3::RequestBody
- Inherits:
-
Yori::SchemaBase
- Object
- Hash
- Yori::SchemaBase
- Yori::Schema::V3::RequestBody
- Defined in:
- lib/yori/schema/v3/request_body.rb
Overview
RequestBody: Describes a single request body.
Instance Attribute Summary
Attributes inherited from Yori::SchemaBase
Instance Method Summary collapse
-
#content ⇒ Object
REQUIRED.
-
#description ⇒ Object
A brief description of the request body.
-
#required ⇒ Object
Determines if the request body is required in the request.
- #validate! ⇒ Object
Methods inherited from Yori::SchemaBase
eval_class!, eval_hash!, eval_input!, #ref, #validator
Instance Method Details
#content ⇒ Object
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 |
#description ⇒ Object
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 |
#required ⇒ Object
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 |