Skip to content

Commit

Permalink
Stop polluting rust/ and go/ with temporary OpenAPI file
Browse files Browse the repository at this point in the history
  • Loading branch information
svix-jplatte committed Jan 15, 2025
1 parent 0bd652a commit ae24a33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion go/.gitignore

This file was deleted.

7 changes: 3 additions & 4 deletions regen_openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
2 changes: 0 additions & 2 deletions rust/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
Cargo.lock

/.openapi-generator/
/openapi.json

0 comments on commit ae24a33

Please sign in to comment.