From fd9d23e39c528a32546e08954339b82c429c67fc Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 28 Jan 2019 19:33:32 -0800 Subject: wrote a whole thing to log Warning headers and not needed --- rust/codegen_openapi2.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rust') 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>/release_date: Option/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::() -- cgit v1.2.3