Fix regex attribute when it uses dereferencing

This commit is contained in:
Graham Esau 2024-08-27 19:26:02 +01:00
parent ae2b5f16c0
commit d7ff81de96
2 changed files with 12 additions and 4 deletions

View file

@ -69,7 +69,7 @@ impl ValidationAttrs {
if let Some(regex) = &self.regex {
mutators.push(quote! {
schemars::_private::insert_validation_property(#mut_ref_schema, "string", "pattern", #regex.to_string());
schemars::_private::insert_validation_property(#mut_ref_schema, "string", "pattern", (#regex).to_string());
});
}