Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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