# Schema associations

Use `yaml.schemas` to map a schema path or URL to a filename or glob. In VS Code, place the association in `.vscode/settings.json`. To apply the same mapping in the checker, use [`.oxyaml.toml`](/docs/cli/config/).

```json
{
  "yaml.schemas": {
    "./schemas/service.json": "services/*.yaml"
  }
}
```

To select a schema directly in a YAML file, add a [modeline](/docs/configuration/modelines/).

## Docker Compose

To check a Compose file with a custom name, put this modeline on its first line to select the Compose schema.

```yaml
# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/main/schema/compose-spec.json
```

Run `oxyaml check path/to/compose.yaml` to check the file from the command line.

## Kubernetes

Associate a glob with the special `kubernetes` schema to select the schema based on each manifest's `apiVersion` and `kind`.

```json
{
  "yaml.schemas": {
    "kubernetes": ["deploy/**/*.yaml", "deploy/**/*.yml"]
  }
}
```

See the [settings reference](/docs/configuration/settings/) for the Kubernetes version and custom resource schema options.
