-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use crate::gen::SchemaGenerator; | ||
use crate::schema::*; | ||
use crate::JsonSchema; | ||
use indexmap2::{IndexMap, IndexSet}; | ||
use std::collections::{HashMap, HashSet}; | ||
|
||
forward_impl!((<K, V: JsonSchema, H> JsonSchema for IndexMap<K, V, H>) => HashMap<K, V, H>); | ||
forward_impl!((<T: JsonSchema, H> JsonSchema for IndexSet<T, H>) => HashSet<T, H>); |
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,16 @@ | ||
mod util; | ||
use indexmap2::{IndexMap, IndexSet}; | ||
use schemars::JsonSchema; | ||
use util::*; | ||
|
||
#[allow(dead_code)] | ||
#[derive(JsonSchema)] | ||
struct IndexMapTypes { | ||
map: IndexMap<i32, bool>, | ||
set: IndexSet<isize>, | ||
} | ||
|
||
#[test] | ||
fn indexmap_types() -> TestResult { | ||
test_default_generated_schema::<IndexMapTypes>("indexmap") | ||
} |