Sha256: 8174df55ab1c1f017577521535a919f014444ba40375bd09f1121eef3389e44c
Contents?: true
Size: 427 Bytes
Versions: 7
Compression:
Stored size: 427 Bytes
Contents
# frozen_string_literal: true module Openapi3Parser module Validators class MediaType REGEX = %r{ \A (\w+|\*) # word or asterisk / # separating slash ([-+.\w]+|\*) # word (with +, - & .) or asterisk \Z }x.freeze def self.call(input) message = %("#{input}" is not a valid media type) message unless REGEX.match(input) end end end end
Version data entries
7 entries across 7 versions & 2 rubygems