Skip to content

Please add an example of got to validate nested JSON body elements #106

@codeonion

Description

@codeonion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions