Skip to content

Commit

Permalink
Merge pull request #41 from traP-jp/feat/#10-openapi-gen-sh
Browse files Browse the repository at this point in the history
✨ add sh for openapi generator
  • Loading branch information
comavius authored Oct 4, 2024
2 parents f33b3ec + a770c2d commit cc3d8a7
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions judge-control-app/generate-api-crate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

source ../.env.dev

# Create directories if they don't exist
if [ ! -d "judge-api-server" ]; then
mkdir judge-api-server
fi
if [ ! -d "backend-api-schema" ]; then
mkdir backend-api-schema
fi

# Download the API schema
curl "${JUDGE_TO_BACKEND_API}" > judge-api-server/judge-api.yaml
curl "${BACKEND_TO_JUDGE_API}" > backend-api-schema/backend-api.yaml

# Generate the API server crate
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/judge-api-server/judge-api.yaml \
-g rust-axum \
-o /local/judge-api-server \
--additional-properties=packageName=judge_api_server \

# Generate the API schema crate
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/backend-api-schema/backend-api.yaml \
-g rust \
-o /local/backend-api-schema \
--additional-properties=packageName=backend_api_schema \

0 comments on commit cc3d8a7

Please sign in to comment.