Fortinet black logo

Administration Guide

Importing JSON schema files

Importing JSON schema files

JSON schema files define JSON data structure and validate JSON data contents in a JSON document. When you use JSON schema files to check JSON contents in HTTP requests, FortiWeb can determine acceptable content and validate that the content is well-formed.

To configure FortiWeb to enforce JSON schema files, create a JSON protection rule and select a JSON schema file for that rule. You can select only one JSON schema file for each JSON protection rule, but you can configure FortiWeb to enforce multiple rules in JSON protection policies.

This section provides instructions to:

  • Import a JSON schema file
  • Select a JSON schema file in a JSON protection rule
To import a JSON schema file
  1. Go to API Protection > JSON Protection.
  2. Select the JSON Schema tab.
  3. Click Create New.
  4. Enter a name for the JSON schema file.
  5. For Upload File, click Choose File.
  6. Select an acceptable JSON schema file.
  7. Click OK.
Please use a JSON validation tool to verify the JSON schema file before uploading it to FortiWeb. It's recommended to use this one: HTTPs://www.jsonschemavalidator.net/.
To select a JSON schema file in a JSON protection rule

For details about creating a JSON protection rule, see Creating JSON protection rules.

  1. Go to API Protection > JSON Protection.
  2. Select the JSON Protection Rule tab.
  3. Select an existing JSON protection rule to which you want to add the JSON schema file.
  4. For Schema Validation, select the JSON schema file from the drop down menu.
  5. Click OK.

Importing JSON schema files

JSON schema files define JSON data structure and validate JSON data contents in a JSON document. When you use JSON schema files to check JSON contents in HTTP requests, FortiWeb can determine acceptable content and validate that the content is well-formed.

To configure FortiWeb to enforce JSON schema files, create a JSON protection rule and select a JSON schema file for that rule. You can select only one JSON schema file for each JSON protection rule, but you can configure FortiWeb to enforce multiple rules in JSON protection policies.

This section provides instructions to:

  • Import a JSON schema file
  • Select a JSON schema file in a JSON protection rule
To import a JSON schema file
  1. Go to API Protection > JSON Protection.
  2. Select the JSON Schema tab.
  3. Click Create New.
  4. Enter a name for the JSON schema file.
  5. For Upload File, click Choose File.
  6. Select an acceptable JSON schema file.
  7. Click OK.
Please use a JSON validation tool to verify the JSON schema file before uploading it to FortiWeb. It's recommended to use this one: HTTPs://www.jsonschemavalidator.net/.
To select a JSON schema file in a JSON protection rule

For details about creating a JSON protection rule, see Creating JSON protection rules.

  1. Go to API Protection > JSON Protection.
  2. Select the JSON Protection Rule tab.
  3. Select an existing JSON protection rule to which you want to add the JSON schema file.
  4. For Schema Validation, select the JSON schema file from the drop down menu.
  5. Click OK.