Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/iracing-typespec/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MacOS
.DS_Store

# Default TypeSpec output
tsp-output/
dist/

# Dependency directories
node_modules/
22 changes: 22 additions & 0 deletions examples/iracing-typespec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# iRacing `/data` API (TypeSpec)

This example ports a small slice of the `/data` API schema into [TypeSpec](https://microsoft.github.io/typespec/). It mirrors
structures from `@iracing-data/api-schema` and the OpenAPI generator in `@iracing-data/api-schema-to-openapi`, but uses TypeSpec's
native emitters to produce OpenAPI definitions.

## Getting started

Install dependencies and compile the TypeSpec project:

```bash
pnpm install
pnpm --filter @examples/iracing-typespec build
```

The included `tspconfig.yaml` is configured to emit OpenAPI v3.1 JSON into `./dist/iracing.typespec.openapi.json`.

## Project layout

- `main.tsp` — The TypeSpec surface area that maps `/data` endpoints to operations.
- `tspconfig.yaml` — Configures the OpenAPI emitter and lints with the standard HTTP/REST rules.
- `package.json` — Declares the TypeSpec toolchain dependencies.
413 changes: 413 additions & 0 deletions examples/iracing-typespec/main.tsp

Large diffs are not rendered by default.

Loading