Implement JsonSchema for slices

This commit is contained in:
Graham Esau 2021-03-23 11:06:16 +00:00
parent 7bcd6a2a65
commit 32b3f77bf7
2 changed files with 5 additions and 3 deletions

View file

@ -3,6 +3,7 @@
## **In-dev** - [0.8.1] ## **In-dev** - [0.8.1]
### Added: ### Added:
- `SchemaGenerator::definitions_mut()` which returns a mutable reference to the generator's schema definitions - `SchemaGenerator::definitions_mut()` which returns a mutable reference to the generator's schema definitions
- Implement `JsonSchema` for slices
### Changed: ### Changed:
- Minimum supported rust version is now 1.37.0 - Minimum supported rust version is now 1.37.0

View file

@ -57,10 +57,11 @@ macro_rules! set_impl {
}; };
} }
seq_impl!(<T> JsonSchema for std::collections::BinaryHeap<T>); seq_impl!(<T> JsonSchema for std::collections::BinaryHeap<T>);
set_impl!(<T> JsonSchema for std::collections::BTreeSet<T>);
set_impl!(<T, H> JsonSchema for std::collections::HashSet<T, H>);
seq_impl!(<T> JsonSchema for std::collections::LinkedList<T>); seq_impl!(<T> JsonSchema for std::collections::LinkedList<T>);
seq_impl!(<T> JsonSchema for [T]);
seq_impl!(<T> JsonSchema for Vec<T>); seq_impl!(<T> JsonSchema for Vec<T>);
seq_impl!(<T> JsonSchema for std::collections::VecDeque<T>); seq_impl!(<T> JsonSchema for std::collections::VecDeque<T>);
set_impl!(<T> JsonSchema for std::collections::BTreeSet<T>);
set_impl!(<T, H> JsonSchema for std::collections::HashSet<T, H>);