summaryrefslogtreecommitdiffstats
path: root/rust
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-28 19:33:32 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-28 19:33:32 -0800
commitfd9d23e39c528a32546e08954339b82c429c67fc (patch)
treec694cdf55609d9f17e2752ce61ada30214817ad9 /rust
parent722d30e403c1a1cd67bf5d36520b6ed1d6d38a46 (diff)
downloadfatcat-fd9d23e39c528a32546e08954339b82c429c67fc.tar.gz
fatcat-fd9d23e39c528a32546e08954339b82c429c67fc.zip
wrote a whole thing to log Warning headers and not needed
Diffstat (limited to 'rust')
-rwxr-xr-xrust/codegen_openapi2.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/rust/codegen_openapi2.sh b/rust/codegen_openapi2.sh
index a3950c58..a26d3db6 100755
--- a/rust/codegen_openapi2.sh
+++ b/rust/codegen_openapi2.sh
@@ -11,6 +11,9 @@ sed -i 's/extern crate uuid;/extern crate serde_json;\nextern crate uuid;/g' fat
# Hack to fix "release_date" as Date, not DateTime
sed -i 's/release_date: Option<chrono::DateTime<chrono::Utc>>/release_date: Option<chrono::NaiveDate>/g' fatcat-api-spec/src/models.rs
+# Hack to optionally log unknown request fields (not actually needed)
+#sed -i 's/\(response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements)));\)/\1 warn!("unknown fields in request body: {:?}", unused_elements);/g' fatcat-api-spec/src/server.rs
+
# Hack to require that optional params parse correctly (boolean, integer, datetime)
# If we reformat, this this should basically go from, eg:
# .and_then(|x| x.parse::<i64>()