Skip to content

Commit 0ed71d5

Browse files
committed
docs(README): add YAML and TypeSpec format support documentation
- Added 'Multiple File Format Support' section to Key Features - Documented YAML support (.yaml, .yml extensions) - Documented TypeSpec pre-compilation workflow - Added TypeSpec installation and usage instructions - Linked to gts-spec TypeSpec examples TypeSpec files must be compiled to JSON Schema externally before loading.
1 parent 5059504 commit 0ed71d5

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,34 @@ gts/
130130

131131
## Key Features
132132

133-
- Full support for JSONC (JSON with Comments)
134-
- Automated GTS entities discovery in `*.json` or `*.gts` files
135-
- JSON / JSON schema validation with respect of GTS ids for schemas
136-
- JSONC support for comments and trailing commas
133+
- **Multiple File Format Support:**
134+
- **JSON**: Standard JSON format (`.json`, `.jsonc`, `.gts`)
135+
- **JSONC**: JSON with Comments - supports single-line comments, multi-line comments, and trailing commas
136+
- **YAML**: Full YAML support (`.yaml`, `.yml`) - automatically parsed and treated identically to JSON
137+
- **TypeSpec**: Pre-compiled TypeSpec schemas (see below)
138+
- Automated GTS entities discovery across all supported file formats
139+
- JSON / JSON Schema validation with respect to GTS IDs for schemas
137140
- Visual GTS entities layout editor and persistence
138141
- Invalid file detection and error reporting
139142

143+
### TypeSpec Support
144+
145+
TypeSpec (`.tsp`) schemas must be pre-compiled to JSON Schema before use with GTS Viewer.
146+
147+
**Setup:**
148+
```bash
149+
# Install TypeSpec compiler
150+
npm install -g @typespec/compiler @typespec/json-schema
151+
152+
# Compile TypeSpec to JSON Schema
153+
tsp compile --emit @typespec/json-schema your-schemas/
154+
```
155+
156+
**Usage:**
157+
Point GTS Viewer to the generated JSON Schema output directory (e.g., `tsp-output/@typespec/json-schema/`). The viewer will automatically discover and load the compiled schemas.
158+
159+
See [gts-spec TypeSpec examples](https://github.com/globaltypesystem/gts-spec/tree/main/examples/typespec) for sample TypeSpec definitions.
160+
140161
## Building
141162

142163
```

0 commit comments

Comments
 (0)