Skip to content

Instantly share code, notes, and snippets.

@bradenmacdonald
Created March 29, 2019 21:30
Show Gist options
  • Save bradenmacdonald/cf5279e443ed054500b3a2bcd8c29f14 to your computer and use it in GitHub Desktop.
Save bradenmacdonald/cf5279e443ed054500b3a2bcd8c29f14 to your computer and use it in GitHub Desktop.
OPENAPI_CODEGEN_VERSION=4.0.0-beta2
OPENAPI_JAR=../.openapi-generator-cli-${OPENAPI_CODEGEN_VERSION}.jar
OPENAPI_DOWNLOAD_BASE_URL="http://central.maven.org/maven2/org/openapitools/openapi-generator-cli"
if [ ! -f $OPENAPI_JAR ]; then
curl ${OPENAPI_DOWNLOAD_BASE_URL}/${OPENAPI_CODEGEN_VERSION}/openapi-generator-cli-${OPENAPI_CODEGEN_VERSION}.jar \
> $OPENAPI_JAR
fi
java -jar $OPENAPI_JAR generate \
--input-spec ../common/openapi/api-spec.yaml \
--generator-name typescript-fetch \
--output packages/api_client \
--config packages/api_client/openapi-generator-config.json \
--remove-operation-id-prefix
cd packages/api_client
rm -rf dist
npm install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment