0.1.6 - implement JsonSchema for unsized types

This commit is contained in:
Graham Esau 2019-08-11 17:58:07 +01:00
parent 6eba5df7b3
commit f45181aac3
4 changed files with 6 additions and 6 deletions

View file

@ -2,14 +2,14 @@
name = "schemars"
description = "Generate JSON Schemas from Rust code"
repository = "https://github.com/GREsau/schemars"
version = "0.1.5"
version = "0.1.6"
authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2018"
license = "MIT"
keywords = ["rust", "json-schema", "serde"]
[dependencies]
schemars_derive = { version = "0.1.5", path = "../schemars_derive" }
schemars_derive = { version = "0.1.6", path = "../schemars_derive" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

View file

@ -295,7 +295,7 @@ impl<T: JsonSchema> JsonSchema for Option<T> {
}
}
impl<T> JsonSchema for std::marker::PhantomData<T> {
impl<T: ?Sized> JsonSchema for std::marker::PhantomData<T> {
no_ref_schema!();
fn schema_name() -> String {
@ -313,7 +313,7 @@ macro_rules! deref_impl {
($($desc:tt)+) => {
impl $($desc)+
where
T: JsonSchema,
T: ?Sized + JsonSchema,
{
fn is_referenceable() -> bool {
T::is_referenceable()

View file

@ -29,7 +29,7 @@ struct Deep2 {
#[derive(Debug, JsonSchema)]
struct Deep3 {
baz: String,
baz: &'static str,
}
#[test]

View file

@ -2,7 +2,7 @@
name = "schemars_derive"
description = "Macros for #[derive(JsonSchema)], for use with schemars"
repository = "https://github.com/GREsau/schemars"
version = "0.1.5"
version = "0.1.6"
authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2018"
license = "MIT"