File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export const fullFormats: DefinedFormats = {
71
71
"relative-json-pointer" : / ^ (?: 0 | [ 1 - 9 ] [ 0 - 9 ] * ) (?: # | (?: \/ (?: [ ^ ~ / ] | ~ 0 | ~ 1 ) * ) * ) $ / ,
72
72
// the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
73
73
// byte: https://github.com/miguelmota/is-base64
74
- byte : / ^ (?: [ A - Z a - z 0 - 9 + / ] { 4 } ) * (?: [ A - Z a - z 0 - 9 + / ] { 2 } = = | [ A - Z a - z 0 - 9 + / ] { 3 } = ) ? $ / gm ,
74
+ byte,
75
75
// signed 32 bit integer
76
76
int32 : { type : "number" , validate : validateInt32 } ,
77
77
// signed 64 bit integer
@@ -191,6 +191,11 @@ function uri(str: string): boolean {
191
191
return NOT_URI_FRAGMENT . test ( str ) && URI . test ( str )
192
192
}
193
193
194
+ function byte ( str : string ) : boolean {
195
+ const BYTE = / ^ (?: [ A - Z a - z 0 - 9 + / ] { 4 } ) * (?: [ A - Z a - z 0 - 9 + / ] { 2 } = = | [ A - Z a - z 0 - 9 + / ] { 3 } = ) ? $ / gm
196
+ return BYTE . test ( str )
197
+ }
198
+
194
199
const MIN_INT32 = - ( 2 ** 31 )
195
200
const MAX_INT32 = 2 ** 31 - 1
196
201
Original file line number Diff line number Diff line change 743
743
"data" : " VGhpcyBpcyBhIGJhc2U2NCBtdWx0aWxpbmUgc3RyaW5nIHRoYXQgc3BhbnMgbW9yZSB0aGFuIDc2\n IGNoYXJhY3RlcnMgdG8gdGVzdCBtdWx0aWxpbmUgY2FwYWJpbGl0aWVzCg==" ,
744
744
"valid" : true
745
745
},
746
+ {
747
+ "description" : " second round multiline base64" ,
748
+ "data" : " VGhpcyBpcyBhIGJhc2U2NCBtdWx0aWxpbmUgc3RyaW5nIHRoYXQgc3BhbnMgbW9yZSB0aGFuIDc2\n IGNoYXJhY3RlcnMgdG8gdGVzdCBtdWx0aWxpbmUgY2FwYWJpbGl0aWVzCg==" ,
749
+ "valid" : true
750
+ },
746
751
{
747
752
"description" : " Invalid base64" ,
748
753
"data" : " aGVsbG8gd29ybG=" ,
You can’t perform that action at this time.
0 commit comments