From ae24a33da82ad417d748580565d4dca91c73f6b4 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 15 Jan 2025 11:41:43 +0100 Subject: [PATCH] Stop polluting rust/ and go/ with temporary OpenAPI file --- go/.gitignore | 1 - regen_openapi.sh | 7 +++---- rust/.gitignore | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 go/.gitignore diff --git a/go/.gitignore b/go/.gitignore deleted file mode 100644 index d836fdca4..000000000 --- a/go/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/openapi.json diff --git a/regen_openapi.sh b/regen_openapi.sh index e700cdd93..82361ef27 100755 --- a/regen_openapi.sh +++ b/regen_openapi.sh @@ -36,15 +36,14 @@ jq --indent 4 '.components.schemas |= with_entries( end )' \ < .codegen-tmp/openapi.json \ - | tee go/openapi.json \ - > rust/openapi.json + > .codegen-tmp/openapi-less-null.json yarn openapi-generator-cli generate -i .codegen-tmp/openapi.json -g typescript -o javascript/src/openapi -c javascript/openapi-generator-config.json --type-mappings=set=Array -t javascript/templates # Cleanup previous codegen, allowing us to spot removals. # If the removals are expected, stage them eg. `git add -u`, then commit them. rm -f go/internal/openapi/*.go -yarn openapi-generator-cli generate -i go/openapi.json -g go -o go/internal/openapi -c go/openapi-generator-config.json -t go/templates +yarn openapi-generator-cli generate -i .codegen-tmp/openapi-less-null.json -g go -o go/internal/openapi -c go/openapi-generator-config.json -t go/templates yarn openapi-generator-cli generate -i .codegen-tmp/openapi.json -g java -o java/lib/generated/openapi -c java/openapi-generator-config.json -t java/templates @@ -57,7 +56,7 @@ yarn openapi-generator-cli generate -i .codegen-tmp/openapi.json -g csharp -o cs # Cleanup previous codegen, allowing us to spot removals. # If the removals are expected, stage them eg. `git add -u`, then commit them. rm -rf rust/src/models -yarn openapi-generator-cli generate -i rust/openapi.json -g rust -o rust/ -c rust/openapi-generator-config.json -t rust/templates +yarn openapi-generator-cli generate -i .codegen-tmp/openapi-less-null.json -g rust -o rust/ -c rust/openapi-generator-config.json -t rust/templates rm -rf .codegen-tmp echo Note: Python generation is not executed automatically. diff --git a/rust/.gitignore b/rust/.gitignore index dc357bdca..c81866ace 100644 --- a/rust/.gitignore +++ b/rust/.gitignore @@ -3,5 +3,3 @@ Cargo.lock /.openapi-generator/ -/openapi.json -