# Export: JSON Schema

> Export a data contract to a JSON Schema document for validating JSON data.

#  Export: JSON Schema

Converts the data contract to a [JSON Schema](https://json-schema.org/) document.

{/* AUTOGENERATED EXAMPLE: do not edit by hand; regenerate with the update script. */}

```bash
datacontract export jsonschema orders.odcs.yaml --schema-name orders --output orders.schema.json
```

Running this against the [example `orders` contract](https://github.com/datacontract/datacontract-cli/blob/main/examples/orders/orders.odcs.yaml) produces:

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "order_id": {
      "type": "string",
      "primaryKey": true,
      "unique": true,
      "description": "Unique identifier of the order."
    },
    "order_timestamp": {
      "type": "string",
      "format": "date",
      "description": "Timestamp when the order was placed."
    },
    "customer_id": {
      "type": "string",
      "description": "Reference to the customer who placed the order."
    },
    "order_total": {
      "type": "number",
      "description": "Total amount of the order in cents."
    },
    "status": {
      "type": "string",
      "description": "Current fulfilment status of the order."
    }
  },
  "required": [
    "order_id",
    "order_timestamp",
    "customer_id",
    "order_total",
    "status"
  ],
  "description": "One row per customer order."
}
```

{/* END AUTOGENERATED EXAMPLE */}

All options: **[`datacontract export jsonschema`](../commands/export/jsonschema.md)**.
