From aa30663ca55980b34ff65aee1d07f738f3b3c1eb Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 21 Feb 2021 16:14:11 +0100 Subject: [PATCH] docgen: improve regex format --- src/bin/docgen.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/docgen.rs b/src/bin/docgen.rs index b0b85610..0d37a041 100644 --- a/src/bin/docgen.rs +++ b/src/bin/docgen.rs @@ -128,7 +128,8 @@ pub fn dump_schema(schema: &Schema) -> Value { match string_schema.format { None | Some(ApiStringFormat::VerifyFn(_)) => { /* do nothing */ } Some(ApiStringFormat::Pattern(const_regex)) => { - data["pattern"] = const_regex.regex_string.into(); + data["pattern"] = format!("/{}/", const_regex.regex_string) + .into(); } Some(ApiStringFormat::Enum(variants)) => { let variants: Vec = variants