Skip to content

Commit

Permalink
openapi3: fix deprecation comments (#1034)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored Nov 26, 2024
1 parent 02a0d6f commit be48da5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/docs/openapi3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions openapi3/schema_formats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit be48da5

Please sign in to comment.