---
title: "Incoming body validation with JSON Schema"
description: "Protect your API from bad inputs using JSON Schema validation and Zuplo. Learn how to validate API requests using JSON schema."
canonicalUrl: "https://zuplo.com/blog/2022/03/18/incoming-body-validation-with-json-schema"
pageType: "blog"
date: "2022-03-18"
authors: "josh"
tags: "JSON Schema, API Request Validation, Tutorial"
image: "https://zuplo.com/og?text=Incoming%20body%20validation%20with%20JSON%20Schema"
---
Bad inputs can easily break your API. Stop bad form before it even hits your API
with Zuplo. In this demo we show how you can add JSON validation to an API
without touching your original API.

<YouTubeVideo videoId="BY8DQyhN_0c" />

Length: 2 minutes

We use JSON Schema with our JSON Validation policy. Here's the schema:

```json
{
  "title": "Person",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The person's first name.",
      "pattern": "\\S+ \\S+"
    },
    "company": {
      "type": "string"
    }
  },

  "additionalProperties": false,
  "required": ["name"]
}
```

Easy peasy.