Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement JsonSchema for Rocket types #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions schemars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ smallvec1 = { version = "1.0", default-features = false, optional = true, packag
smol_str02 = { version = "0.2.1", default-features = false, optional = true, package = "smol_str" }
url2 = { version = "2.0", default-features = false, optional = true, package = "url" }
uuid1 = { version = "1.0", default-features = false, optional = true, package = "uuid" }
rocket05 = { version = "0.5", default-features = false, optional = true, package = "rocket" }

[dev-dependencies]
pretty_assertions = "1.2.1"
Expand Down
3 changes: 3 additions & 0 deletions schemars/src/json_schema_impls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ mod url2;

#[cfg(feature = "uuid1")]
mod uuid1;

#[cfg(feature = "rocket05")]
mod rocket05;
8 changes: 8 additions & 0 deletions schemars/src/json_schema_impls/rocket05.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use alloc::string::String;
use alloc::vec::Vec;

forward_impl!(rocket05::fs::TempFile<'_> => Vec<u8>);
forward_impl!(rocket05::fs::NamedFile => Vec<u8>);

forward_impl!(rocket05::http::RawStr => String);
forward_impl!(rocket05::http::RawStrBuf => String);