summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2022-08-11 19:39:17 -0700
committerBryan Newbold <bnewbold@archive.org>2022-08-11 19:39:17 -0700
commit7392e457fae4d9f7b3dfa79dccfdaf23d6f9d1a5 (patch)
tree92382ab0b1a9e5edd87a32a7c54d60c0087571ae
parent611fb0a0ff0906204dc74b1fe926916d86709139 (diff)
downloadfatcat-cli-7392e457fae4d9f7b3dfa79dccfdaf23d6f9d1a5.tar.gz
fatcat-cli-7392e457fae4d9f7b3dfa79dccfdaf23d6f9d1a5.zip
codegen: update script to use generator v6.0.1
-rwxr-xr-xcodegen_openapi.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/codegen_openapi.sh b/codegen_openapi.sh
index 94a5457..6cda986 100755
--- a/codegen_openapi.sh
+++ b/codegen_openapi.sh
@@ -8,7 +8,7 @@ OUTPUT=`pwd`/fatcat-openapi
mkdir -p $OUTPUT
cat ./fatcat-openapi3.yml | grep -v "TAGLINE$" | perl -0777 -pe "s/<\!-- STARTLONGDESCRIPTION -->.*<\!-- ENDLONGDESCRIPTION -->//s" > $OUTPUT/api.yaml
-export OPENAPI_GENERATOR_VERSION=5.0.0
+export OPENAPI_GENERATOR_VERSION=6.0.1
./openapi-generator-cli.sh \
generate \
--generator-name rust-server \
@@ -27,7 +27,7 @@ echo "Patching..."
# Hack to fix "release_date" (and "withdrawn_date") as Date, not DateTime
sed -i 's/_date: Option<chrono::DateTime<chrono::Utc>>/_date: Option<chrono::NaiveDate>/g' src/models.rs
sed -i 's/_date: Vec<chrono::DateTime<chrono::Utc>>/_date: Vec<chrono::NaiveDate>/g' src/models.rs
-perl -0777 -pi -e 's/_date\.push\(\n\s+chrono::DateTime::<chrono::Utc>::from_str/_date\.push\(chrono::NaiveDate::from_str/gs' src/models.rs
+perl -0777 -pi -e 's/_date\.push\(\n\s+<chrono::DateTime<chrono::Utc> as std::str/_date\.push\(<chrono::NaiveDate as std::str/gs' src/models.rs
# unnecessary duplicate copies of API spec
rm api.yaml