Class: Openapi3Parser::Validators::MediaType
- Inherits:
-
Object
- Object
- Openapi3Parser::Validators::MediaType
- Defined in:
- lib/openapi3_parser/validators/media_type.rb
Constant Summary collapse
- REGEX =
%r{ \A (\w+|\*) # word or asterisk / # separating slash ([-+.\w]+|\*) # word (with +, - & .) or asterisk \Z }x
Class Method Summary collapse
Class Method Details
.call(input) ⇒ Object
14 15 16 17 |
# File 'lib/openapi3_parser/validators/media_type.rb', line 14 def self.call(input) = %("#{input}" is not a valid media type) unless REGEX.match(input) end |