diff --git a/.github/docs/openapi3.txt b/.github/docs/openapi3.txt index a1631dff..4729e0c3 100644 --- a/.github/docs/openapi3.txt +++ b/.github/docs/openapi3.txt @@ -128,13 +128,16 @@ func DefineNumberFormatValidator(name string, validator NumberFormatValidator) number format. func DefineStringFormat(name string, pattern string) - DefineStringFormat defines a regexp pattern for a given string - format Deprecated: Use openapi3.DefineStringFormatValidator(name, + DefineStringFormat defines a regexp pattern for a given string format + + Deprecated: Use openapi3.DefineStringFormatValidator(name, NewRegexpFormatValidator(pattern)) instead. func DefineStringFormatCallback(name string, callback func(string) error) - DefineStringFormatCallback defines a callback function for a given - string format Deprecated: Use openapi3.DefineStringFormatValidator(name, + DefineStringFormatCallback defines a callback function for a given string + format + + Deprecated: Use openapi3.DefineStringFormatValidator(name, NewCallbackValidator(fn)) instead. func DefineStringFormatValidator(name string, validator StringFormatValidator) diff --git a/openapi3/schema_formats.go b/openapi3/schema_formats.go index 023c2669..1b76707f 100644 --- a/openapi3/schema_formats.go +++ b/openapi3/schema_formats.go @@ -131,12 +131,14 @@ func DefineIntegerFormatValidator(name string, validator IntegerFormatValidator) } // DefineStringFormat defines a regexp pattern for a given string format +// // Deprecated: Use openapi3.DefineStringFormatValidator(name, NewRegexpFormatValidator(pattern)) instead. func DefineStringFormat(name string, pattern string) { DefineStringFormatValidator(name, NewRegexpFormatValidator(pattern)) } // DefineStringFormatCallback defines a callback function for a given string format +// // Deprecated: Use openapi3.DefineStringFormatValidator(name, NewCallbackValidator(fn)) instead. func DefineStringFormatCallback(name string, callback func(string) error) { DefineStringFormatValidator(name, NewCallbackValidator(callback))