-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
impl JsonSchema for basic camino types
- Loading branch information
Showing
5 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use crate::gen::SchemaGenerator; | ||
use crate::schema::*; | ||
use crate::JsonSchema; | ||
use camino::{Utf8Path, Utf8PathBuf}; | ||
|
||
impl JsonSchema for Utf8Path { | ||
no_ref_schema!(); | ||
|
||
fn schema_name() -> String { | ||
"String".to_owned() | ||
} | ||
|
||
fn json_schema(_: &mut SchemaGenerator) -> Schema { | ||
SchemaObject { | ||
instance_type: Some(InstanceType::String.into()), | ||
..Default::default() | ||
} | ||
.into() | ||
} | ||
} | ||
|
||
impl JsonSchema for Utf8PathBuf { | ||
no_ref_schema!(); | ||
|
||
fn schema_name() -> String { | ||
"String".to_owned() | ||
} | ||
|
||
fn json_schema(_: &mut SchemaGenerator) -> Schema { | ||
SchemaObject { | ||
instance_type: Some(InstanceType::String.into()), | ||
..Default::default() | ||
} | ||
.into() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,3 +75,5 @@ mod uuid08; | |
#[cfg(feature = "uuid1")] | ||
mod uuid1; | ||
mod wrapper; | ||
#[cfg(feature = "camino")] | ||
mod camino; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters