File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,18 @@ func init() {
211211 // defined as date-time in https://www.rfc-editor.org/rfc/rfc3339#section-5.6
212212 DefineStringFormat ("date-time" , `^[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T(23:59:60|(([01][0-9]|2[0-3])(:[0-5][0-9]){2}))(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})?$` )
213213
214+ // defined as uuid in https://www.rfc-editor.org/rfc/rfc4122
215+ DefineStringFormat ("uuid" , FormatOfStringForUUIDOfRFC4122 , FromOpenAPIMinorVersion (1 ))
216+
217+ // defined as ipv4 in
218+ DefineStringFormatCallback ("ipv4" , validateIPv4 , FromOpenAPIMinorVersion (1 ))
219+
220+ // defined as ipv6 in https://www.rfc-editor.org/rfc/rfc4122
221+ DefineStringFormatCallback ("ipv6" , validateIPv6 , FromOpenAPIMinorVersion (1 ))
222+
223+ // hostname as defined in https://www.rfc-editor.org/rfc/rfc1123#section-2.1
224+ DefineStringFormat (`hostname` , `^[a-zA-Z0-9][a-zA-Z0-9-.]+[a-zA-Z0-9]$` , FromOpenAPIMinorVersion (1 ))
225+
214226 defaultSchemaStringFormats = SaveStringFormats (SchemaStringFormats )
215227}
216228
You can’t perform that action at this time.
0 commit comments