File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -145,23 +145,14 @@ pub enum Schema {
145145}
146146
147147#[ derive( Hash , PartialEq , Eq ) ]
148- pub struct Identifier ( & ' static str ) ;
148+ pub struct Identifier ( core :: any :: TypeId ) ;
149149
150150impl Identifier {
151151 pub fn of < T > ( ) -> Self
152152 where
153- T : ?Sized ,
153+ T : ?Sized + ' static ,
154154 {
155- Self ( core:: any:: type_name :: < T > ( ) )
156- }
157- }
158-
159- impl Serialize for Identifier {
160- fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
161- where
162- S : serde:: Serializer ,
163- {
164- self . 0 . serialize ( serializer)
155+ Self ( core:: any:: TypeId :: of :: < T > ( ) )
165156 }
166157}
167158
@@ -191,7 +182,7 @@ impl SchemaVisitor {
191182 }
192183}
193184
194- pub trait Schemaifier {
185+ pub trait Schemaifier : ' static {
195186 #[ doc( hidden) ]
196187 fn id ( ) -> Identifier {
197188 Identifier :: of :: < Self > ( )
Original file line number Diff line number Diff line change @@ -392,6 +392,18 @@ expression: schema
392392 " type" ,
393393 " inner"
394394 ]
395+ },
396+ {
397+ " type" : " object" ,
398+ " properties" : {
399+ " type" : {
400+ " type" : " string" ,
401+ " const" : " unit"
402+ }
403+ },
404+ " required" : [
405+ " type"
406+ ]
395407 }
396408 ],
397409 " required" : [
You can’t perform that action at this time.
0 commit comments