mirror of
https://github.com/brittonhayes/validate-yaml.git
synced 2024-11-26 23:11:00 -05:00
fix: more detailed readme
This commit is contained in:
parent
6fc4d63bf2
commit
1bd11c863b
1 changed files with 31 additions and 0 deletions
31
README.md
31
README.md
|
@ -37,3 +37,34 @@ test:
|
|||
myValue: '1'
|
||||
myValue2: '2'
|
||||
```
|
||||
|
||||
### More Complex Schema
|
||||
|
||||
- Use `?` to indicate an optional field
|
||||
- Specify the preferred type with values like "string" or "number"
|
||||
- Replicate deeply nested structures in JSON to represent expected YAML
|
||||
|
||||
```json
|
||||
{
|
||||
"structure": {
|
||||
"school": {
|
||||
"description?": "string",
|
||||
"code": "number",
|
||||
"principal": {
|
||||
"name": "string"
|
||||
},
|
||||
"classRooms": [
|
||||
{
|
||||
"name": "string",
|
||||
"id": "number",
|
||||
"location?": {
|
||||
"floor": "string",
|
||||
"building": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"teachers": ["string"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue