openapi-generator provides a Docker image
openapi-generator provides a Docker image that can be used to as part of a pipeline. See https://openapi-generator.tech/#try and scroll down to Docker.
They give an example:
docker run --rm \
-v $PWD:/local openapitools/openapi-generator-cli generate \
-i /local/petstore.yaml \
-g go \
-o /local/out/go
Can/should we replace part of our build with this?