diff --git a/etc/api/type-api.yaml b/etc/api/type-api.yaml index 7f988c0f89..6c0e57783a 100644 --- a/etc/api/type-api.yaml +++ b/etc/api/type-api.yaml @@ -27,4 +27,4 @@ cargo: - url = "*" - serde = ">= 0.3.0" - serde_macros = "*" - - json-tools = "*" + - json-tools = ">= 0.3.0" diff --git a/src/mako/api/lib/mbuild.mako b/src/mako/api/lib/mbuild.mako index d5ce19689d..cd754549e6 100644 --- a/src/mako/api/lib/mbuild.mako +++ b/src/mako/api/lib/mbuild.mako @@ -484,7 +484,7 @@ match result { use url::percent_encoding::{percent_encode, FORM_URLENCODED_ENCODE_SET}; % endif % if request_value: - use json_tools::{TokenReader, Lexer, BufferType, TokenType, FilterTypedKeyValuePairs}; + use json_tools::{TokenReader, Lexer, BufferType, TokenType, FilterTypedKeyValuePairs, IteratorExt}; % endif use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location}; @@ -670,13 +670,9 @@ else { { let json_cache = json::to_string(&self.${property(REQUEST_VALUE_PROPERTY_NAME)}).unwrap(); let mut mem_dst = io::Cursor::new(Vec::with_capacity(json_cache.len())); - io::copy(&mut TokenReader::new( - FilterTypedKeyValuePairs::new( - Lexer::new( - json_cache.bytes(), - BufferType::Span), - TokenType::Null), - Some(&json_cache)), &mut mem_dst).unwrap(); + io::copy(&mut Lexer::new(json_cache.bytes(), BufferType::Span) + .filter_key_value_by_type(TokenType::Null) + .reader(Some(&json_cache)), &mut mem_dst).unwrap(); mem_dst.seek(io::SeekFrom::Start(0)).unwrap(); mem_dst };