A plain JavaScript validator for AT Protocol lexicon schemas
at main 83 lines 1.5 kB view raw
1// Test inputs for bytes schema validation 2 3export const bytesSchemaInputs = [ 4 { 5 name: 'bytes-valid-basic', 6 lexicon: { 7 lexicon: 1, 8 id: 'test.bytes.basic', 9 defs: { 10 main: { 11 type: 'bytes', 12 }, 13 }, 14 }, 15 }, 16 { 17 name: 'bytes-valid-with-constraints', 18 lexicon: { 19 lexicon: 1, 20 id: 'test.bytes.constraints', 21 defs: { 22 main: { 23 type: 'bytes', 24 minLength: 10, 25 maxLength: 20, 26 }, 27 }, 28 }, 29 }, 30 { 31 name: 'bytes-valid-with-description', 32 lexicon: { 33 lexicon: 1, 34 id: 'test.bytes.description', 35 defs: { 36 main: { 37 type: 'bytes', 38 description: 'Binary data', 39 }, 40 }, 41 }, 42 }, 43 { 44 name: 'bytes-invalid-max-less-than-min', 45 lexicon: { 46 lexicon: 1, 47 id: 'test.bytes.badlength', 48 defs: { 49 main: { 50 type: 'bytes', 51 minLength: 20, 52 maxLength: 10, 53 }, 54 }, 55 }, 56 }, 57 { 58 name: 'bytes-invalid-negative-min', 59 lexicon: { 60 lexicon: 1, 61 id: 'test.bytes.negmin', 62 defs: { 63 main: { 64 type: 'bytes', 65 minLength: -1, 66 }, 67 }, 68 }, 69 }, 70 { 71 name: 'bytes-invalid-negative-max', 72 lexicon: { 73 lexicon: 1, 74 id: 'test.bytes.negmax', 75 defs: { 76 main: { 77 type: 'bytes', 78 maxLength: -5, 79 }, 80 }, 81 }, 82 }, 83];