Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add script to generate OAI models #27

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from 5 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
18 changes: 18 additions & 0 deletions build-models.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Define the list of OpenAPI specifications and their corresponding API names and destination directories
declare -A SPECS
SPECS["serviceinfo"]="https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-info/develop/service-info.yaml lib/src/serviceinfo/"
SPECS["tes"]="https://raw.githubusercontent.com/ga4gh/task-execution-schemas/develop/openapi/task_execution_service.openapi.yaml lib/src/tes/"

# Directory of the build script
BUILD_SCRIPT="./script.sh"
aaravm marked this conversation as resolved.
Show resolved Hide resolved

# Iterate over the specifications and call the build script for each
for API_NAME in "${!SPECS[@]}"; do
SPEC_URL=$(echo ${SPECS[$API_NAME]} | awk '{print $1}')
DESTINATION_DIR=$(echo ${SPECS[$API_NAME]} | awk '{print $2}')

echo "Generating models for $API_NAME from $SPEC_URL into $DESTINATION_DIR"
$BUILD_SCRIPT "$SPEC_URL" "$API_NAME" "$DESTINATION_DIR"
done