JSON Schema Validator

Paste your JSON schema to validate it for OpenAI function calling — catch errors before your API call fails.

  • Free
  • No account
  • Runs in your browser
  • Nothing uploaded
JSON Schema ValidatorNothing uploaded
0 characters

Paste a JSON schema above to validate it for OpenAI function calling, or click Load example to try a working schema.

Runs entirely in your browser — your input is never uploaded, logged, or stored.Privacy policy

What is JSON Schema Validator?

JSON Schema is a standard for describing the structure and constraints of JSON data. OpenAI's function calling feature uses JSON Schema to define the parameters your functions accept, so the model knows what arguments to generate.

A valid function calling schema has specific requirements: it must have a `type` of `object` at the top level, a `properties` object describing each parameter, and a `required` array listing mandatory fields. Each property needs a `type`, and most should have a `description` so the model understands what to pass.

This validator checks your schema against the JSON Schema specification and OpenAI's function calling requirements. It catches common mistakes like missing descriptions, invalid types, nested schemas without definitions, and structural issues that cause API errors.

The tool reports three severity levels: errors (will cause API failures), warnings (likely problems), and info (best practice suggestions). Fix errors first, then warnings, to ensure your function calling works reliably.

Validation checks performed:

1. JSON syntax — is the input valid JSON? 2. Top-level structure — must be an object with `type: "object"` 3. Properties — each must have a `type` and ideally a `description` 4. Required array — all listed fields must exist in `properties` 5. Type validity — types must be JSON Schema primitive types (string, number, integer, boolean, array, object, null) 6. Nested objects — recursive validation of nested schemas 7. Array items — if `type: "array"`, should have `items` schema 8. Enum values — if present, must be a non-empty array 9. OpenAI-specific — function name constraints, parameter naming conventions

Each issue is classified as error (will cause API failure), warning (likely a problem), or info (best practice suggestion).

Worked examples

  • Valid schema: {"type":"object","properties":{"city":{"type":"string","description":"City name"}},"required":["city"]} → 0 errors, 0 warnings, valid for function calling.
  • Missing required field: {"type":"object","properties":{"city":{"type":"string"}}} → Warning: property "city" has no description.
  • Invalid type: {"type":"object","properties":{"count":{"type":"int"}}} → Error: "int" is not a valid JSON Schema type. Use "integer".
  • Missing properties: {"type":"object","required":["name"]} → Error: required field "name" not found in properties.
  • Non-object top level: {"type":"string"} → Error: function calling schema must have type "object" at the top level.

How to use JSON Schema Validator

  1. Paste your JSON schema in the input box — this is the schema you pass in the `parameters` field of a function definition.
  2. Click Validate to check the schema.
  3. Review any errors — these will cause API failures and must be fixed.
  4. Review warnings — these are likely problems but may not cause immediate failures.
  5. Review info messages — these are best practice suggestions for better function calling.
  6. Fix issues in your schema and re-validate until you see zero errors.

Common errors

  • Unexpected token in JSON — the input is not valid JSON. Check for trailing commas, missing quotes, or syntax errors.
  • Schema must be an object — the input parsed as JSON but is not an object (e.g., it is an array or primitive).
  • Missing type field — every object and property should have a `type` field.
  • Invalid type — types must be one of: string, number, integer, boolean, array, object, null.
  • Required field not in properties — the `required` array lists a field that is not defined in `properties`.
  • Array without items — when `type` is `array`, you should define what the array contains with an `items` schema.

FAQ

What is JSON Schema?

JSON Schema is a standard for describing the structure, constraints, and documentation of JSON data. It lets you define what fields an object should have, what types they are, and what values are allowed.

Why do I need to validate my schema before calling the API?

OpenAI's API validates your schema when you create a function definition. If the schema is invalid, the API returns an error and you have to fix it and retry. Validating first catches errors instantly in your browser instead of making a failed API call.

What makes a schema good for function calling?

Three things: every property should have a clear `description` (so the model knows what to pass), types should be specific (use `integer` not `number` for whole numbers), and required fields should be explicitly listed. The description is especially important — it is the primary way the model understands your function's parameters.

Can I use $ref or $defs in my schema?

Yes, but this validator only checks that they exist — it does not resolve or validate the referenced schemas. For complex schemas with many definitions, use a dedicated JSON Schema validator library in your code.

Does this validate my data against the schema?

No. This tool validates the schema itself, not data. To validate data against a schema, use a library like ajv or jsonschema in your application.

G

Prefer AllUtil on Google

One click adds AllUtil to your Google preferences. You'll see our tools highlighted with a Preferred badge in Search and AI answers.

2× more likely to clickWorks in AI Overviews

Reviewed by unreviewed

Written by Hamza AK. We research, build and test every tool before it is published.

Editorial policy

Last updated

Rechecked against the sources on this date, not stamped.

Methodology

This validator checks structural correctness against the JSON Schema specification (draft-07) and OpenAI's function calling requirements. It does not validate data against a schema — it validates the schema itself. Some advanced JSON Schema features (oneOf, anyOf, $ref) are checked for presence but not fully resolved. The tool catches the common mistakes that cause 90% of function calling API errors.

JSON Schema Validator: Function Calling — AllUtil