Method: OpenapiClient::ApiClient#json_mime?

Defined in:
lib/openapi_client/api_client.rb

#json_mime?(mime) ⇒ Boolean

Check if the given MIME is a JSON MIME. JSON MIME examples:

application/json
application/json; charset=UTF8
APPLICATION/JSON
*/*

Parameters:

  • mime (String)

    MIME

Returns:

  • (Boolean)

    True if the MIME is application/json



165
166
167
# File 'lib/openapi_client/api_client.rb', line 165

def json_mime?(mime)
  (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
end