Skip to content
Merged
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
23 changes: 23 additions & 0 deletions api/scripts/gen_typescript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# generate api spec in typescript based on openapi.yaml

# dependencies:
# - npm:
# - openapi-typescript
# - typescript

# fail command if any part fails
set -euo pipefail

# echo linting
echo "Linting api/openapi.yaml..."

# lint openapi spec
redocly lint api/openapi.yaml

# echo linting
echo "generating client/src/api.ts..."

# generate using openapi-typescript
openapi-typescript api/openapi.yaml -o client/src/api.ts
Loading