# use swagger files generated by buf for client gen

for file in $(find gen/openapi -type f -name "*.swagger.json"); do
    echo "building api client ${file}..."
    docker run --rm -it -v ${HOME}:${HOME} -w ${PWD}/api/def/clients/$(echo "${file}" | xargs -n1 dirname | xargs -n1 basename) quay.io/goswagger/swagger generate client -f ${PWD}/${file}
done
