Skip to content

Commit

Permalink
add TS generated schema
Browse files Browse the repository at this point in the history
  • Loading branch information
lostbean committed Dec 7, 2023
1 parent 3641c23 commit 86817d0
Show file tree
Hide file tree
Showing 2 changed files with 1,608 additions and 5 deletions.
14 changes: 9 additions & 5 deletions api/openapi/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

set -euo pipefail # Bash "strict mode"
script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
api_root_dirpath="$(dirname "${script_dirpath}")"
openapi_root_dirpath="$(dirname "${script_dirpath}")"
api_root_dirpath="$(dirname "${openapi_root_dirpath}")"

echo "Generating data models for REST API "
oapi-codegen --config="$api_root_dirpath/generators/api_types.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml"
oapi-codegen --config="$openapi_root_dirpath/generators/api_types.cfg.yaml" "$openapi_root_dirpath/specs/kurtosis_api.yaml"

echo "Generating server code for REST API "
oapi-codegen --config="$api_root_dirpath/generators/engine_server.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml"
oapi-codegen --config="$api_root_dirpath/generators/core_server.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml"
oapi-codegen --config="$api_root_dirpath/generators/websocket_server.cfg.yaml" "$api_root_dirpath/specs/kurtosis_api.yaml"
oapi-codegen --config="$openapi_root_dirpath/generators/engine_server.cfg.yaml" "$openapi_root_dirpath/specs/kurtosis_api.yaml"
oapi-codegen --config="$openapi_root_dirpath/generators/core_server.cfg.yaml" "$openapi_root_dirpath/specs/kurtosis_api.yaml"
oapi-codegen --config="$openapi_root_dirpath/generators/websocket_server.cfg.yaml" "$openapi_root_dirpath/specs/kurtosis_api.yaml"

echo "Generating Typescript client code for REST API "
openapi-typescript "$openapi_root_dirpath/specs/kurtosis_api.yaml" -o "$api_root_dirpath/typescript/src/engine/rest_api_bindings/types.d.ts"
Loading

0 comments on commit 86817d0

Please sign in to comment.