> ## Documentation Index
> Fetch the complete documentation index at: https://statsig-4b2ff144-mintlify-add-local-eval-country-note-96362.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using a schema

> Learn how to use JSON Schema to enforce consistent return values for dynamic config rules

Dynamic configs support schemas using [JSON Schema](https://json-schema.org/learn/getting-started-step-by-step) syntax to enforce a common convention between the return values for each rule you'll set.

<Info>
  Schemas are only enforced when editing dynamic configs through the console or API, and are not used at code runtime.
</Info>

For example, if you have a dynamic config that returns settings for a site banner, you might have a schema of:

```
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
    },
    "description": {
      "type": "string",
    },
    "cta": {
      "type": "string",
    }
  },
  "required": ["title", "description", "cta"],
}
```

Now, each of your rules must return an object including title, description, and CTA.

## Infer schema from current values

You can also infer schema based on the current values in your targeting rule variations. This is useful as a quick starting point for validations or for documenting the expected shape of your config.

<img src="https://mintcdn.com/statsig-4b2ff144-mintlify-add-local-eval-country-note-96362/qHeIkFK7pmXzP5PM/images/infer-schema.png?fit=max&auto=format&n=qHeIkFK7pmXzP5PM&q=85&s=7a4f5f4556fd5240672fb23efa8c1a4b" alt="Infer schema from current values" width="2718" height="626" data-path="images/infer-schema.png" />

**Important - JSON5 output**

Statsig emits the inferred schema in JSON5 (a super set of JSON). JSON5 allows **unquoted object keys** and trailing commas. This might fail other standard JSON Schema validators and typical unit-test tooling. Statsig accepts JSON5 in the Console and API, but if you want strict JSON for validators or tests you should convert the output.
