So lets see this JSON body
{
"configuration": {
"type": "",
"height": "apple",
"width": false,
"cost_in_usd": "not afforable"
}
}
If this is posted in a POST request, and I am using
require 'rack' require 'rack/contrib'
and
use Rack::JSONBodyParser
helpers Sinatra::Param
I need to know how to validate the above mentioned JSON keys under configuration.
Type is empty, height and width and cost have wrongly provided values.