Add schema_id(), handles different types with the same name (#247)
This commit is contained in:
parent
53bb51cb25
commit
342b2dff33
26 changed files with 415 additions and 34 deletions
|
@ -109,6 +109,15 @@ fn type_for_schema(with_attr: &WithAttr) -> (syn::Type, Option<TokenStream>) {
|
|||
#fn_name.to_string()
|
||||
}
|
||||
|
||||
fn schema_id() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(std::concat!(
|
||||
"_SchemarsSchemaWithFunction/",
|
||||
std::module_path!(),
|
||||
"/",
|
||||
#fn_name
|
||||
))
|
||||
}
|
||||
|
||||
fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
|
||||
#fun(gen)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue