[{"data":1,"prerenderedAt":1102},["ShallowReactive",2],{"page:\u002Fextensions\u002Fkubb-labs\u002Fplugin-valibot\u002Fguides\u002Fformat-mappings":3},{"id":4,"frontmatter":5,"title":6,"heading":6,"body":7,"path":1101,"source":4},"extensions\u002Fkubb-labs\u002Fplugin-valibot\u002Fguides\u002Fformat-mappings.md",{},"Valibot schemas for OpenAPI formats",{"type":8,"value":9,"toc":1088},"minimark",[10,27,51,56,229,245,249,453,458,462,530,544,549,562,636,657,661,907,911,917,1038,1051,1068,1079],[11,12,13,14,18,19,22,23,26],"p",{},"Look up the Valibot call Kubb writes for each OpenAPI type and format, such as ",[15,16,17],"code",{},"v.uuid()"," for ",[15,20,21],{},"format: uuid",", and the keywords that add a ",[15,24,25],{},"v.check",".",[11,28,29,32,33,36,37,40,41,36,44,47,48,26],{},[15,30,31],{},"@kubb\u002Fplugin-valibot"," reads the ",[15,34,35],{},"type"," and ",[15,38,39],{},"format"," of each schema and prints the matching Valibot call. Constraints such as ",[15,42,43],{},"minLength",[15,45,46],{},"maximum"," go into the same ",[15,49,50],{},"v.pipe(...)",[52,53,55],"h2",{"id":54},"numbers","Numbers",[57,58,59,76],"table",{},[60,61,62],"thead",{},[63,64,65,70,73],"tr",{},[66,67,69],"th",{"style":68},"text-align:left","OpenAPI type and format",[66,71,72],{"style":68},"Valibot",[66,74,75],{"style":68},"Notes",[77,78,79,94,130,151,176,195,215],"tbody",{},[63,80,81,87,92],{},[82,83,84],"td",{"style":68},[15,85,86],{},"number",[82,88,89],{"style":68},[15,90,91],{},"v.number()",[82,93],{"style":68},[63,95,96,101,106],{},[82,97,98],{"style":68},[15,99,100],{},"integer",[82,102,103],{"style":68},[15,104,105],{},"v.pipe(v.number(), v.integer())",[82,107,108,111,112,111,115,118,119,122,123,36,126,129],{"style":68},[15,109,110],{},"format: int8",", ",[15,113,114],{},"int16",[15,116,117],{},"int32",", and their ",[15,120,121],{},"uint"," forms add ",[15,124,125],{},"v.minValue()",[15,127,128],{},"v.maxValue()"," for the format's range",[63,131,132,143,148],{},[82,133,134,111,136,139,140],{"style":68},[15,135,100],{},[15,137,138],{},"format: int64"," \u002F ",[15,141,142],{},"uint64",[82,144,145],{"style":68},[15,146,147],{},"v.pipe(v.union([v.bigint(), v.number(), v.string()]), v.toBigint(), v.minValue(BigInt('…')), v.maxValue(BigInt('…')))",[82,149,150],{"style":68},"Converts, because JSON holds a number or a string, then checks the format's range",[63,152,153,164,169],{},[82,154,155,111,158,139,161],{"style":68},[15,156,157],{},"string",[15,159,160],{},"format: int32",[15,162,163],{},"int64",[82,165,166],{"style":68},[15,167,168],{},"v.pipe(v.string(), v.regex(\u002F^-?\\d+$\u002F))",[82,170,171,172,175],{"style":68},"An integer sent as a JSON string. A ",[15,173,174],{},"pattern"," in the spec wins.",[63,177,178,185,193],{},[82,179,180,111,183],{"style":68},[15,181,182],{},"minimum",[15,184,46],{},[82,186,187,111,190],{"style":68},[15,188,189],{},"v.minValue(n)",[15,191,192],{},"v.maxValue(n)",[82,194],{"style":68},[63,196,197,205,213],{},[82,198,199,111,202],{"style":68},[15,200,201],{},"exclusiveMinimum",[15,203,204],{},"exclusiveMaximum",[82,206,207,111,210],{"style":68},[15,208,209],{},"v.gtValue(n)",[15,211,212],{},"v.ltValue(n)",[82,214],{"style":68},[63,216,217,222,227],{},[82,218,219],{"style":68},[15,220,221],{},"multipleOf",[82,223,224],{"style":68},[15,225,226],{},"v.multipleOf(n)",[82,228],{"style":68},[11,230,231,232,239,240,242,243,26],{},"With ",[233,234,236],"a",{"href":235},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fadapter-oas\u002Foptions#integertype",[15,237,238],{},"integerType: 'number'"," on the adapter, ",[15,241,138],{}," prints ",[15,244,105],{},[52,246,248],{"id":247},"strings","Strings",[57,250,251,261],{},[60,252,253],{},[63,254,255,257,259],{},[66,256,69],{"style":68},[66,258,72],{"style":68},[66,260,75],{"style":68},[77,262,263,276,291,307,323,347,367,383,399,430],{},[63,264,265,269,274],{},[82,266,267],{"style":68},[15,268,157],{},[82,270,271],{"style":68},[15,272,273],{},"v.string()",[82,275],{"style":68},[63,277,278,284,289],{},[82,279,280,111,282],{"style":68},[15,281,157],{},[15,283,21],{},[82,285,286],{"style":68},[15,287,288],{},"v.pipe(v.string(), v.uuid())",[82,290],{"style":68},[63,292,293,300,305],{},[82,294,295,111,297],{"style":68},[15,296,157],{},[15,298,299],{},"format: email",[82,301,302],{"style":68},[15,303,304],{},"v.pipe(v.string(), v.email())",[82,306],{"style":68},[63,308,309,316,321],{},[82,310,311,111,313],{"style":68},[15,312,157],{},[15,314,315],{},"format: uri",[82,317,318],{"style":68},[15,319,320],{},"v.pipe(v.string(), v.url())",[82,322],{"style":68},[63,324,325,335,340],{},[82,326,327,111,329,139,332],{"style":68},[15,328,157],{},[15,330,331],{},"format: ipv4",[15,333,334],{},"ipv6",[82,336,337],{"style":68},[15,338,339],{},"v.pipe(v.string(), v.ipv4())",[82,341,342,18,345],{"style":68},[15,343,344],{},"v.ipv6()",[15,346,334],{},[63,348,349,356,361],{},[82,350,351,111,353],{"style":68},[15,352,157],{},[15,354,355],{},"format: byte",[82,357,358],{"style":68},[15,359,360],{},"v.pipe(v.string(), v.base64())",[82,362,363,364],{"style":68},"Also for ",[15,365,366],{},"contentEncoding: base64",[63,368,369,376,381],{},[82,370,371,111,373],{"style":68},[15,372,157],{},[15,374,375],{},"format: ulid",[82,377,378],{"style":68},[15,379,380],{},"v.pipe(v.string(), v.ulid())",[82,382],{"style":68},[63,384,385,392,397],{},[82,386,387,111,389],{"style":68},[15,388,157],{},[15,390,391],{},"format: binary",[82,393,394],{"style":68},[15,395,396],{},"v.blob()",[82,398],{"style":68},[63,400,401,410,421],{},[82,402,403,111,405,111,408],{"style":68},[15,404,43],{},[15,406,407],{},"maxLength",[15,409,174],{},[82,411,412,111,415,111,418],{"style":68},[15,413,414],{},"v.minLength(n)",[15,416,417],{},"v.maxLength(n)",[15,419,420],{},"v.regex(...)",[82,422,423,424],{"style":68},"See ",[233,425,427],{"href":426},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-valibot\u002Foptions#regextype",[15,428,429],{},"regexType",[63,431,432,437,442],{},[82,433,434],{"style":68},[15,435,436],{},"enum",[82,438,439],{"style":68},[15,440,441],{},"v.picklist([...])",[82,443,444,445,448,449,452],{"style":68},"A single value prints ",[15,446,447],{},"v.literal(...)",". A boolean or mixed set prints a ",[15,450,451],{},"v.union"," of literals",[11,454,455,456,26],{},"Any other string format prints ",[15,457,273],{},[52,459,461],{"id":460},"dates-and-times","Dates and times",[57,463,464,474],{},[60,465,466],{},[63,467,468,470,472],{},[66,469,69],{"style":68},[66,471,72],{"style":68},[66,473,75],{"style":68},[77,475,476,493,514],{},[63,477,478,485,490],{},[82,479,480,111,482],{"style":68},[15,481,157],{},[15,483,484],{},"format: date",[82,486,487],{"style":68},[15,488,489],{},"v.pipe(v.string(), v.isoDate())",[82,491,492],{"style":68},"ISO 8601 date",[63,494,495,502,507],{},[82,496,497,111,499],{"style":68},[15,498,157],{},[15,500,501],{},"format: date-time",[82,503,504],{"style":68},[15,505,506],{},"v.pipe(v.string(), v.isoTimestamp())",[82,508,509,510,513],{"style":68},"Needs a ",[15,511,512],{},"Z"," or an offset",[63,515,516,523,527],{},[82,517,518,111,520],{"style":68},[15,519,157],{},[15,521,522],{},"format: time",[82,524,525],{"style":68},[15,526,273],{},[82,528,529],{"style":68},"Not checked. Valibot's time actions reject fractional seconds.",[11,531,532,533,536,537,540,541,543],{},"These rows apply to the adapter's default ",[15,534,535],{},"dateType: 'string'",". With ",[15,538,539],{},"dateType: 'stringLocal'",", a date-time prints ",[15,542,273],{},", because Valibot has no check for a date-time without an offset.",[545,546,548],"h3",{"id":547},"date-fields","Date fields",[11,550,231,551,554,555,558,559,561],{},[15,552,553],{},"dateType: 'date'",", a date, date-time, or time is a ",[15,556,557],{},"Date"," in your code and a string on the wire. A response schema converts the string to a ",[15,560,557],{},", and a request schema converts it back:",[57,563,564,576],{},[60,565,566],{},[63,567,568,570,573],{},[66,569,69],{"style":68},[66,571,572],{"style":68},"Response schema",[66,574,575],{"style":68},"Request schema",[77,577,578,596,614],{},[63,579,580,586,591],{},[82,581,582,111,584],{"style":68},[15,583,157],{},[15,585,484],{},[82,587,588],{"style":68},[15,589,590],{},"v.pipe(v.string(), v.isoDate(), v.transform((value) => new Date(value)))",[82,592,593],{"style":68},[15,594,595],{},"v.pipe(v.date(), v.transform((value) => value.toISOString().slice(0, 10)))",[63,597,598,604,609],{},[82,599,600,111,602],{"style":68},[15,601,157],{},[15,603,501],{},[82,605,606],{"style":68},[15,607,608],{},"v.pipe(v.string(), v.isoTimestamp(), v.transform(...))",[82,610,611],{"style":68},[15,612,613],{},"v.pipe(v.date(), v.transform((value) => value.toISOString()))",[63,615,616,622,629],{},[82,617,618,111,620],{"style":68},[15,619,157],{},[15,621,522],{},[82,623,624,625,628],{"style":68},"Parses onto ",[15,626,627],{},"1970-01-01",", as UTC when the value has no offset",[82,630,631,632,635],{"style":68},"Writes ",[15,633,634],{},"HH:mm:ssZ",", with milliseconds when the value has them",[11,637,638,639,642,643,646,647,653,654,26],{},"A component schema with such a field is generated twice: ",[15,640,641],{},"petSchema"," for responses and ",[15,644,645],{},"petInputSchema"," for requests. With ",[233,648,650],{"href":649},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-valibot\u002Foptions#coercion",[15,651,652],{},"coercion"," for dates, the response schema prints ",[15,655,656],{},"v.pipe(v.unknown(), v.toDate())",[52,658,660],{"id":659},"objects-arrays-and-unions","Objects, arrays, and unions",[57,662,663,674],{},[60,664,665],{},[63,666,667,670,672],{},[66,668,669],{"style":68},"OpenAPI",[66,671,72],{"style":68},[66,673,75],{"style":68},[77,675,676,691,708,725,748,767,781,802,823,837,851,871,891],{},[63,677,678,683,688],{},[82,679,680],{"style":68},[15,681,682],{},"object",[82,684,685],{"style":68},[15,686,687],{},"v.object(entries)",[82,689,690],{"style":68},"Drops unknown keys from the output",[63,692,693,700,705],{},[82,694,695,111,697],{"style":68},[15,696,682],{},[15,698,699],{},"additionalProperties: false",[82,701,702],{"style":68},[15,703,704],{},"v.strictObject(entries)",[82,706,707],{"style":68},"Rejects extra keys",[63,709,710,717,722],{},[82,711,712,111,714],{"style":68},[15,713,682],{},[15,715,716],{},"additionalProperties: true",[82,718,719],{"style":68},[15,720,721],{},"v.looseObject(entries)",[82,723,724],{"style":68},"Keeps extra keys",[63,726,727,734,739],{},[82,728,729,111,731],{"style":68},[15,730,682],{},[15,732,733],{},"additionalProperties: \u003Cschema>",[82,735,736],{"style":68},[15,737,738],{},"v.record(v.string(), schema)",[82,740,741,744,745],{"style":68},[15,742,743],{},"v.objectWithRest(entries, schema)"," next to ",[15,746,747],{},"properties",[63,749,750,753,758],{},[82,751,752],{"style":68},"Optional property",[82,754,755],{"style":68},[15,756,757],{},"v.optional(schema)",[82,759,760,761,242,764],{"style":68},"A ",[15,762,763],{},"default",[15,765,766],{},"v.optional(schema, value)",[63,768,769,774,779],{},[82,770,771],{"style":68},[15,772,773],{},"nullable: true",[82,775,776],{"style":68},[15,777,778],{},"v.nullable(schema)",[82,780],{"style":68},[63,782,783,788,793],{},[82,784,785],{"style":68},[15,786,787],{},"array",[82,789,790],{"style":68},[15,791,792],{},"v.array(schema)",[82,794,795,798,799],{"style":68},[15,796,797],{},"uniqueItems"," adds a ",[15,800,801],{},"v.check(...)",[63,803,804,809,814],{},[82,805,806],{"style":68},[15,807,808],{},"prefixItems",[82,810,811],{"style":68},[15,812,813],{},"v.tuple([...])",[82,815,816,819,820],{"style":68},[15,817,818],{},"v.tupleWithRest([...], schema)"," with ",[15,821,822],{},"items",[63,824,825,830,835],{},[82,826,827],{"style":68},[15,828,829],{},"anyOf",[82,831,832],{"style":68},[15,833,834],{},"v.union([...])",[82,836],{"style":68},[63,838,839,844,848],{},[82,840,841],{"style":68},[15,842,843],{},"oneOf",[82,845,846],{"style":68},[15,847,834],{},[82,849,850],{"style":68},"Plain object members are strict, so a value with another member's keys does not match them",[63,852,853,861,866],{},[82,854,855,857,858],{"style":68},[15,856,843],{}," with a ",[15,859,860],{},"discriminator",[82,862,863],{"style":68},[15,864,865],{},"v.variant(key, [...])",[82,867,868,870],{"style":68},[15,869,451],{}," when a member is not a plain object",[63,872,873,879,884],{},[82,874,875,878],{"style":68},[15,876,877],{},"allOf"," of objects",[82,880,881],{"style":68},[15,882,883],{},"v.object({ ...base.entries, ... })",[82,885,886,887,890],{"style":68},"Other members print ",[15,888,889],{},"v.intersect([...])",", or extra actions in the pipe when a member only adds constraints",[63,892,893,898,901],{},[82,894,895],{"style":68},[15,896,897],{},"$ref",[82,899,900],{"style":68},"The schema's const",[82,902,903,906],{"style":68},[15,904,905],{},"v.lazy(() => schema)"," for a circular reference",[52,908,910],{"id":909},"json-schema-keywords","JSON Schema keywords",[11,912,913,914,916],{},"These keywords print a ",[15,915,25],{},":",[57,918,919,929],{},[60,920,921],{},[63,922,923,926],{},[66,924,925],{},"Keyword",[66,927,928],{},"Check",[77,930,931,957,972,988,1002,1018,1029],{},[63,932,933,951],{},[82,934,935,938,939,938,942,111,945,111,948],{},[15,936,937],{},"if","\u002F",[15,940,941],{},"then",[15,943,944],{},"else",[15,946,947],{},"dependentRequired",[15,949,950],{},"dependentSchemas",[82,952,953,954,26],{},"Checks the input before parsing, in ",[15,955,956],{},"v.pipe(v.unknown(), v.check(...), schema)",[63,958,959,967],{},[82,960,961,111,964],{},[15,962,963],{},"minProperties",[15,965,966],{},"maxProperties",[82,968,969,970,26],{},"Counts the keys of the input before parsing, in the same ",[15,971,50],{},[63,973,974,982],{},[82,975,976,979,980],{},[15,977,978],{},"propertyNames"," on an object that also declares ",[15,981,747],{},[82,983,984,985,26],{},"Checks every key of the input. A dictionary keeps ",[15,986,987],{},"v.record(keySchema, schema)",[63,989,990,999],{},[82,991,992,744,995,36,997],{},[15,993,994],{},"patternProperties",[15,996,747],{},[15,998,699],{},[82,1000,1001],{},"Rejects a key that is not declared and matches no pattern.",[63,1003,1004,1015],{},[82,1005,1006,819,1009,36,1012],{},[15,1007,1008],{},"contains",[15,1010,1011],{},"minContains",[15,1013,1014],{},"maxContains",[82,1016,1017],{},"Counts the matching items of an array.",[63,1019,1020,1026],{},[82,1021,1022,1025],{},[15,1023,1024],{},"contentSchema"," on a string that holds JSON",[82,1027,1028],{},"Parses the string and checks the result.",[63,1030,1031,1035],{},[82,1032,1033],{},[15,1034,797],{},[82,1036,1037],{},"Rejects an array with duplicate entries.",[11,1039,1040,1041,1044,1045,1047,1048,1050],{},"A request body that is a circular schema prints inline without its ",[15,1042,1043],{},"readOnly"," keys. In a circular ",[15,1046,877],{},", a ",[15,1049,897],{}," member that declares such a key prints inline too.",[11,1052,1053,1054,1057,1058,1061,1062,1064,1065,1067],{},"A schema with a check on the input is a ",[15,1055,1056],{},"v.pipe",", so it is no member of a ",[15,1059,1060],{},"v.variant"," and does not merge into an ",[15,1063,877],{}," object. A request body that drops ",[15,1066,1043],{}," keys from such a schema leaves the input checks out.",[11,1069,1070,1071,1074,1075,1078],{},"The plugin does not write ",[15,1072,1073],{},"description"," or ",[15,1076,1077],{},"examples"," into the schemas.",[11,1080,1081,1082,26],{},"To change the call for one type, replace its handler with ",[233,1083,1085],{"href":1084},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-valibot\u002Foptions#printer",[15,1086,1087],{},"printer",{"title":1089,"searchDepth":1090,"depth":1090,"links":1091},"",5,[1092,1094,1095,1099,1100],{"id":54,"depth":1093,"text":55},2,{"id":247,"depth":1093,"text":248},{"id":460,"depth":1093,"text":461,"children":1096},[1097],{"id":547,"depth":1098,"text":548},3,{"id":659,"depth":1093,"text":660},{"id":909,"depth":1093,"text":910},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-valibot\u002Fguides\u002Fformat-mappings",1795015656398]