curl -o openapi.yml https://raw.githubusercontent.com/motis-project/motis/refs/heads/master/openapi.yaml
openapi-generator-cli generate -g rust -i openapi.yml --package-name motis-openapi-sdk

# Fix too long description
sed -i 's/description = .*/description = "Automatically generated code for the Motis OpenAPI description."/' Cargo.toml

# Change autor of autogenerated package; it is different from the autor of the OpenAPI specification.
sed -i 's/felix@triptix.tech/Julian Schmidhuber <railway-backend@schmidhuberj.de>/' Cargo.toml

# Disable clippy on generated code.
sed -i '1s/^/#![allow(clippy::all)]\n/' src/lib.rs
