#!/bin/bash
shopt -s extglob

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
    -i /local/dash_api.yaml \
    --git-host=github.com \
    --git-user-id=moustachioed \
    --git-repo-id=dash \
    --api-package dashapi \
    --artifact-id dashapi \
    --invoker-package dashapi \
    --package-name dashapi \
    -g go-server \
    -p packageName=dashapi,featureCORS=true,outputAsLibrary=true,sourceFolder=dashapi \
    -o /local/api_server

rm -rf ../backend/dashapi
cp -r ./api_server/dashapi ../backend/
