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 = {
7171 "relative-json-pointer" : / ^ (?: 0 | [ 1 - 9 ] [ 0 - 9 ] * ) (?: # | (?: \/ (?: [ ^ ~ / ] | ~ 0 | ~ 1 ) * ) * ) $ / ,
7272 // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
7373 // 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,
7575 // signed 32 bit integer
7676 int32 : { type : "number" , validate : validateInt32 } ,
7777 // signed 64 bit integer
@@ -191,6 +191,11 @@ function uri(str: string): boolean {
191191 return NOT_URI_FRAGMENT . test ( str ) && URI . test ( str )
192192}
193193
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+
194199const MIN_INT32 = - ( 2 ** 31 )
195200const MAX_INT32 = 2 ** 31 - 1
196201
Original file line number Diff line number Diff line change 743743 "data" : " VGhpcyBpcyBhIGJhc2U2NCBtdWx0aWxpbmUgc3RyaW5nIHRoYXQgc3BhbnMgbW9yZSB0aGFuIDc2\n IGNoYXJhY3RlcnMgdG8gdGVzdCBtdWx0aWxpbmUgY2FwYWJpbGl0aWVzCg==" ,
744744 "valid" : true
745745 },
746+ {
747+ "description" : " second round multiline base64" ,
748+ "data" : " VGhpcyBpcyBhIGJhc2U2NCBtdWx0aWxpbmUgc3RyaW5nIHRoYXQgc3BhbnMgbW9yZSB0aGFuIDc2\n IGNoYXJhY3RlcnMgdG8gdGVzdCBtdWx0aWxpbmUgY2FwYWJpbGl0aWVzCg==" ,
749+ "valid" : true
750+ },
746751 {
747752 "description" : " Invalid base64" ,
748753 "data" : " aGVsbG8gd29ybG=" ,
You can’t perform that action at this time.
0 commit comments