1
0
mirror of synced 2025-12-26 14:02:10 -05:00
Files
airbyte/tools/openapi2jsonschema/run.sh
Dmytro 8d2cd1e798 🎉 Tool for generation catalog schema from OpenAPI definition file (#5734)
* Add tool for generating catalog json schema from openapi definition file
2021-09-01 21:35:43 +03:00

27 lines
528 B
Bash
Executable File

#!/usr/bin/env bash
IMG_TAG="airbyte/openapi2jsonschema"
test "$#" == "0" && {
echo "Please specify path to open api definition file"
exit
}
docker images | grep "$IMG_TAG" > /dev/null || {
pushd $(dirname ${BASH_SOURCE[0]})
docker build . -t $IMG_TAG
popd
}
tmp_dir=$(mktemp -d)
cp $1 $tmp_dir || exit
tmp_file=$(basename $1)
docker run --rm \
--name openapi2jsonschema \
--user $(id -u):$(id -g)\
-v $tmp_dir:/schemas \
$IMG_TAG --stand-alone --no-all ./$tmp_file
cp -rf $tmp_dir/schemas ./