Skip to content

Commit

Permalink
docs: add json schema
Browse files Browse the repository at this point in the history
Signed-off-by: rare-magma <[email protected]>
  • Loading branch information
rare-magma committed Jul 26, 2024
1 parent fd5b8c6 commit ae28220
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
88 changes: 88 additions & 0 deletions docs/guitos-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"expenses": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["id", "name", "value"]
}
},
"total": {
"type": "number"
}
}
},
"incomes": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
},
"value": {
"type": "number"
}
},
"required": ["id", "name", "value"]
}
},
"total": {
"type": "number"
}
}
},
"stats": {
"type": "object",
"properties": {
"available": {
"type": "number"
},
"withGoal": {
"type": "number"
},
"saved": {
"type": "number"
},
"goal": {
"type": "number"
},
"reserves": {
"type": "number"
}
}
}
},
"required": ["id", "name", "expenses", "incomes", "stats"]
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"e2e:ui": "playwright test --ui --project chromium",
"lint": "biome check --fix",
"lint:packages": "pnpm dedupe",
"schema": "pnpm dlx generate-schema ./docs/guitos-sample.json",
"serve": "vite preview",
"start": "vite",
"test": "vitest --exclude 'e2e'"
Expand Down

0 comments on commit ae28220

Please sign in to comment.