Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Aug 25, 2024
1 parent 521ece6 commit b4e5ca5
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/docs/usage-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ By default, v8r queries [Schema Store](https://www.schemastore.org/) to detect a
```bash
# if v8r can't auto-detect a schema for your file..
$ v8r feature.geojson
ℹ Processing ./feature.geojson
✖ Could not find a schema to validate feature.geojson

# ..you can specify one using the --schema flag
$ v8r feature.geojson --schema https://json.schemastore.org/geojson
ℹ Processing ./feature.geojson
ℹ Validating feature.geojson against schema from https://json.schemastore.org/geojson ...
✔ feature.geojson is valid
```
Expand All @@ -50,11 +52,29 @@ Using the `--schema` flag will validate all files matched by the glob pattern ag
"fileMatch": ["*.geojson"] } ] }
```

```bash
```
$ v8r feature.geojson -c my-catalog.json
ℹ Processing ./feature.geojson
ℹ Found schema in my-catalog.json ...
ℹ Validating feature.geojson against schema from https://json.schemastore.org/geojson ...
✔ feature.geojson is valid
```

This can be used to specify different custom schemas for multiple file patterns.

## Files Containing Multiple Documents

A single YAML file can contain [multiple documents](https://www.yaml.info/learn/document.html). v8r is able to parse and validate these files. In this situation:

- All documents within the file are assumed to conform to the same schema. It is not possible to validate documents within the same file against different schemas
- Documents within the file are referred to as `multi-doc.yml[0]`, `multi-doc.yml[1]`, etc

```
$ v8r catalog-info.yaml
ℹ Processing ./catalog-info.yaml
ℹ Found schema in https://www.schemastore.org/api/json/catalog.json ...
ℹ Validating ./catalog-info.yaml against schema from https://json.schemastore.org/catalog-info.json ...
✔ ./catalog-info.yaml[0] is valid
✔ ./catalog-info.yaml[1] is valid
```

0 comments on commit b4e5ca5

Please sign in to comment.