validate-json command not found

In this troubleshooting guide we learn how to fix validate-json command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

validate-json: command not found

or when using sudo you get the following error message

sudo: validate-json: command not found

Solutions to validate-json: command not found

How To Fix validate-json: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu validate-json is provided by php-json-schema package.

php-json-schema is:

JSON Schema defines the media type “application/schema+json”, a JSON based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON data is required for a given application and how to interact with it. JSON Schema is intended to define validation, documentation, hyperlink navigation, and interaction control of JSON data.

This package provides a PHP library for validating JSON Structures against a given Schema.

To fix this problem, we can install more using the command below.

sudo apt-get -y install php-json-schema

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install php-json-schema.

sudo apt -y install php-json-schema

Or if you have aptitude installed you can use the following command.

sudo aptitude install php-json-schema

Summary

In this tutorial we learn how to fix validate-json command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.