[{"data":1,"prerenderedAt":3383,"buildId":3384},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval":3},{"id":4,"title":5,"body":6,"description":3365,"extension":3366,"frontmatter":3367,"heading":5,"meta":3374,"navigation":3376,"order":3370,"path":3377,"seo":3378,"sitemap":3379,"source":3380,"stem":3381,"__hash__":3382},"docs\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval.md","Move from orval to Kubb",{"type":7,"value":8,"toc":3348},"minimark",[9,24,47,52,55,740,744,749,911,915,1044],[10,11,12,13,18,19,23],"p",{},"Start with the types, then replace one ",[14,15,17],"a",{"href":16},"https:\u002F\u002Forval.dev","orval"," (",[14,20,22],{"href":21},"https:\u002F\u002Fgithub.com\u002Forval-labs\u002Forval","GitHub",") output at a time: the client, the query hooks, the Zod schemas, and the mocks. You can stop after any step.",[10,25,26,27,31,32,31,35,38,39,42,43,46],{},"The examples move an orval config with ",[28,29,30],"code",{},"client: 'react-query'",", ",[28,33,34],{},"httpClient: 'fetch'",[28,36,37],{},"mock: true",", and a second ",[28,40,41],{},"client: 'zod'"," output, all written to ",[28,44,45],{},"src\u002Fapi",".",[48,49,51],"h2",{"id":50},"the-config-before-and-after","The config, before and after",[10,53,54],{},"The Kubb config is the result of every step below. Each step adds one plugin to it.",[56,57,58,361],"code-group",{},[59,60,65],"pre",{"language":61,"filename":62,"code":63,"class":64},"typescript","orval.config.ts","import { defineConfig } from 'orval'\n\nexport default defineConfig({\n petstore: {\n input: '.\u002Fopenapi.yaml',\n output: {\n mode: 'tags-split',\n target: '.\u002Fsrc\u002Fapi',\n schemas: '.\u002Fsrc\u002Fapi\u002Fmodel',\n client: 'react-query',\n httpClient: 'fetch',\n mock: true,\n },\n },\n petstoreZod: {\n input: '.\u002Fopenapi.yaml',\n output: {\n mode: 'tags-split',\n target: '.\u002Fsrc\u002Fapi',\n client: 'zod',\n fileExtension: '.zod.ts',\n },\n },\n})","highlights",[28,66,68,95,96,95,98,95,113,95,127,95,143,95,154,95,169,95,183,95,197,95,211,95,225,95,239,95,248,95,256,95,267,95,279,95,289,95,301,95,313,95,326,95,340,95,348,95,356],{"class":67},"language-typescript",[69,70,73,77,81,85,88,91],"span",{"class":71,"style":72},"line","display: inline",[69,74,76],{"style":75},"color:#d73a49;--hls-dark:#f97583","import ",[69,78,80],{"style":79},"color:#005cc5;--hls-dark:#79b8ff","{ ",[69,82,84],{"style":83},"color:#24292e;--hls-dark:#e1e4e8","defineConfig ",[69,86,87],{"style":79},"} ",[69,89,90],{"style":75},"from ",[69,92,94],{"style":93},"color:#032f62;--hls-dark:#9ecbff","'orval'","\n",[69,97],{"class":71,"style":72},[69,99,100,103,106,110],{"class":71,"style":72},[69,101,102],{"style":75},"export ",[69,104,105],{"style":75},"default ",[69,107,109],{"style":108},"color:#6f42c1;--hls-dark:#b392f0","defineConfig",[69,111,112],{"style":79},"({",[69,114,115,118,121,124],{"class":71,"style":72},[69,116,117],{"style":79}," ",[69,119,120],{"style":79},"petstore",[69,122,123],{"style":75},": ",[69,125,126],{"style":79},"{",[69,128,129,132,135,137,140],{"class":71,"style":72},[69,130,131],{"style":79}," ",[69,133,134],{"style":79},"input",[69,136,123],{"style":75},[69,138,139],{"style":93},"'.\u002Fopenapi.yaml'",[69,141,142],{"style":75},",",[69,144,145,147,150,152],{"class":71,"style":72},[69,146,131],{"style":75},[69,148,149],{"style":79},"output",[69,151,123],{"style":75},[69,153,126],{"style":79},[69,155,156,159,162,164,167],{"class":71,"style":72},[69,157,158],{"style":79}," ",[69,160,161],{"style":79},"mode",[69,163,123],{"style":75},[69,165,166],{"style":93},"'tags-split'",[69,168,142],{"style":75},[69,170,171,173,176,178,181],{"class":71,"style":72},[69,172,158],{"style":75},[69,174,175],{"style":79},"target",[69,177,123],{"style":75},[69,179,180],{"style":93},"'.\u002Fsrc\u002Fapi'",[69,182,142],{"style":75},[69,184,185,187,190,192,195],{"class":71,"style":72},[69,186,158],{"style":75},[69,188,189],{"style":79},"schemas",[69,191,123],{"style":75},[69,193,194],{"style":93},"'.\u002Fsrc\u002Fapi\u002Fmodel'",[69,196,142],{"style":75},[69,198,199,201,204,206,209],{"class":71,"style":72},[69,200,158],{"style":75},[69,202,203],{"style":79},"client",[69,205,123],{"style":75},[69,207,208],{"style":93},"'react-query'",[69,210,142],{"style":75},[69,212,213,215,218,220,223],{"class":71,"style":72},[69,214,158],{"style":75},[69,216,217],{"style":79},"httpClient",[69,219,123],{"style":75},[69,221,222],{"style":93},"'fetch'",[69,224,142],{"style":75},[69,226,227,229,232,234,237],{"class":71,"style":72},[69,228,158],{"style":75},[69,230,231],{"style":79},"mock",[69,233,123],{"style":75},[69,235,236],{"style":79},"true",[69,238,142],{"style":75},[69,240,241,243,246],{"class":71,"style":72},[69,242,131],{"style":75},[69,244,245],{"style":79},"}",[69,247,142],{"style":75},[69,249,250,252,254],{"class":71,"style":72},[69,251,117],{"style":75},[69,253,245],{"style":79},[69,255,142],{"style":75},[69,257,258,260,263,265],{"class":71,"style":72},[69,259,117],{"style":75},[69,261,262],{"style":79},"petstoreZod",[69,264,123],{"style":75},[69,266,126],{"style":79},[69,268,269,271,273,275,277],{"class":71,"style":72},[69,270,131],{"style":79},[69,272,134],{"style":79},[69,274,123],{"style":75},[69,276,139],{"style":93},[69,278,142],{"style":75},[69,280,281,283,285,287],{"class":71,"style":72},[69,282,131],{"style":75},[69,284,149],{"style":79},[69,286,123],{"style":75},[69,288,126],{"style":79},[69,290,291,293,295,297,299],{"class":71,"style":72},[69,292,158],{"style":79},[69,294,161],{"style":79},[69,296,123],{"style":75},[69,298,166],{"style":93},[69,300,142],{"style":75},[69,302,303,305,307,309,311],{"class":71,"style":72},[69,304,158],{"style":75},[69,306,175],{"style":79},[69,308,123],{"style":75},[69,310,180],{"style":93},[69,312,142],{"style":75},[69,314,315,317,319,321,324],{"class":71,"style":72},[69,316,158],{"style":75},[69,318,203],{"style":79},[69,320,123],{"style":75},[69,322,323],{"style":93},"'zod'",[69,325,142],{"style":75},[69,327,328,330,333,335,338],{"class":71,"style":72},[69,329,158],{"style":75},[69,331,332],{"style":79},"fileExtension",[69,334,123],{"style":75},[69,336,337],{"style":93},"'.zod.ts'",[69,339,142],{"style":75},[69,341,342,344,346],{"class":71,"style":72},[69,343,131],{"style":75},[69,345,245],{"style":79},[69,347,142],{"style":75},[69,349,350,352,354],{"class":71,"style":72},[69,351,117],{"style":75},[69,353,245],{"style":79},[69,355,142],{"style":75},[69,357,358],{"class":71,"style":72},[69,359,360],{"style":79},"})",[59,362,365],{"language":61,"filename":363,"code":364,"class":64},"kubb.config.ts","import { defineConfig } from 'kubb\u002Fconfig'\nimport { adapterOas } from '@kubb\u002Fadapter-oas'\nimport { pluginFaker } from '@kubb\u002Fplugin-faker'\nimport { pluginFetch } from '@kubb\u002Fplugin-fetch'\nimport { pluginMsw } from '@kubb\u002Fplugin-msw'\nimport { pluginReactQuery } from '@kubb\u002Fplugin-react-query'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\nimport { pluginZod } from '@kubb\u002Fplugin-zod'\n\nexport default defineConfig({\n input: '.\u002Fopenapi.yaml',\n output: { path: '.\u002Fsrc\u002Fgen' },\n adapter: adapterOas({ integerType: 'number' }),\n plugins: [\n pluginTs({ output: { path: 'types.ts' } }),\n \u002F\u002F The Petstore URL is an example. Use your API's URL.\n pluginFetch({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', throwOnErrorDefault: false }),\n pluginReactQuery({ hooks: true }),\n pluginZod(),\n pluginFaker(),\n pluginMsw({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', parser: 'faker', handlers: true }),\n ],\n})",[28,366,367,95,382,95,398,95,414,95,430,95,446,95,462,95,478,95,494,95,496,95,506,95,518,95,540,95,567,95,579,95,606,95,614,95,645,95,666,95,678,95,689,95,727,95,736],{"class":67},[69,368,369,371,373,375,377,379],{"class":71,"style":72},[69,370,76],{"style":75},[69,372,80],{"style":79},[69,374,84],{"style":83},[69,376,87],{"style":79},[69,378,90],{"style":75},[69,380,381],{"style":93},"'kubb\u002Fconfig'",[69,383,384,386,388,391,393,395],{"class":71,"style":72},[69,385,76],{"style":75},[69,387,80],{"style":79},[69,389,390],{"style":83},"adapterOas ",[69,392,87],{"style":79},[69,394,90],{"style":75},[69,396,397],{"style":93},"'@kubb\u002Fadapter-oas'",[69,399,400,402,404,407,409,411],{"class":71,"style":72},[69,401,76],{"style":75},[69,403,80],{"style":79},[69,405,406],{"style":83},"pluginFaker ",[69,408,87],{"style":79},[69,410,90],{"style":75},[69,412,413],{"style":93},"'@kubb\u002Fplugin-faker'",[69,415,416,418,420,423,425,427],{"class":71,"style":72},[69,417,76],{"style":75},[69,419,80],{"style":79},[69,421,422],{"style":83},"pluginFetch ",[69,424,87],{"style":79},[69,426,90],{"style":75},[69,428,429],{"style":93},"'@kubb\u002Fplugin-fetch'",[69,431,432,434,436,439,441,443],{"class":71,"style":72},[69,433,76],{"style":75},[69,435,80],{"style":79},[69,437,438],{"style":83},"pluginMsw ",[69,440,87],{"style":79},[69,442,90],{"style":75},[69,444,445],{"style":93},"'@kubb\u002Fplugin-msw'",[69,447,448,450,452,455,457,459],{"class":71,"style":72},[69,449,76],{"style":75},[69,451,80],{"style":79},[69,453,454],{"style":83},"pluginReactQuery ",[69,456,87],{"style":79},[69,458,90],{"style":75},[69,460,461],{"style":93},"'@kubb\u002Fplugin-react-query'",[69,463,464,466,468,471,473,475],{"class":71,"style":72},[69,465,76],{"style":75},[69,467,80],{"style":79},[69,469,470],{"style":83},"pluginTs ",[69,472,87],{"style":79},[69,474,90],{"style":75},[69,476,477],{"style":93},"'@kubb\u002Fplugin-ts'",[69,479,480,482,484,487,489,491],{"class":71,"style":72},[69,481,76],{"style":75},[69,483,80],{"style":79},[69,485,486],{"style":83},"pluginZod ",[69,488,87],{"style":79},[69,490,90],{"style":75},[69,492,493],{"style":93},"'@kubb\u002Fplugin-zod'",[69,495],{"class":71,"style":72},[69,497,498,500,502,504],{"class":71,"style":72},[69,499,102],{"style":75},[69,501,105],{"style":75},[69,503,109],{"style":108},[69,505,112],{"style":79},[69,507,508,510,512,514,516],{"class":71,"style":72},[69,509,117],{"style":79},[69,511,134],{"style":79},[69,513,123],{"style":75},[69,515,139],{"style":93},[69,517,142],{"style":75},[69,519,520,522,524,526,528,531,533,536,538],{"class":71,"style":72},[69,521,117],{"style":75},[69,523,149],{"style":79},[69,525,123],{"style":75},[69,527,80],{"style":79},[69,529,530],{"style":79},"path",[69,532,123],{"style":75},[69,534,535],{"style":93},"'.\u002Fsrc\u002Fgen' ",[69,537,245],{"style":79},[69,539,142],{"style":75},[69,541,542,544,547,549,552,555,558,560,563,565],{"class":71,"style":72},[69,543,117],{"style":75},[69,545,546],{"style":79},"adapter",[69,548,123],{"style":75},[69,550,551],{"style":108},"adapterOas",[69,553,554],{"style":79},"({ ",[69,556,557],{"style":79},"integerType",[69,559,123],{"style":75},[69,561,562],{"style":93},"'number' ",[69,564,360],{"style":79},[69,566,142],{"style":75},[69,568,569,571,574,576],{"class":71,"style":72},[69,570,117],{"style":75},[69,572,573],{"style":79},"plugins",[69,575,123],{"style":75},[69,577,578],{"style":79},"[",[69,580,581,583,586,588,590,592,594,596,598,601,604],{"class":71,"style":72},[69,582,131],{"style":79},[69,584,585],{"style":108},"pluginTs",[69,587,554],{"style":79},[69,589,149],{"style":79},[69,591,123],{"style":75},[69,593,80],{"style":79},[69,595,530],{"style":79},[69,597,123],{"style":75},[69,599,600],{"style":93},"'types.ts' ",[69,602,603],{"style":79},"} })",[69,605,142],{"style":75},[69,607,608,610],{"class":71,"style":72},[69,609,131],{"style":75},[69,611,613],{"style":612},"color:#6a737d;--hls-dark:#6a737d","\u002F\u002F The Petstore URL is an example. Use your API's URL.",[69,615,616,618,621,623,626,628,631,633,636,638,641,643],{"class":71,"style":72},[69,617,131],{"style":612},[69,619,620],{"style":108},"pluginFetch",[69,622,554],{"style":79},[69,624,625],{"style":79},"baseURL",[69,627,123],{"style":75},[69,629,630],{"style":93},"'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3'",[69,632,31],{"style":75},[69,634,635],{"style":79},"throwOnErrorDefault",[69,637,123],{"style":75},[69,639,640],{"style":79},"false ",[69,642,360],{"style":79},[69,644,142],{"style":75},[69,646,647,649,652,654,657,659,662,664],{"class":71,"style":72},[69,648,131],{"style":75},[69,650,651],{"style":108},"pluginReactQuery",[69,653,554],{"style":79},[69,655,656],{"style":79},"hooks",[69,658,123],{"style":75},[69,660,661],{"style":79},"true ",[69,663,360],{"style":79},[69,665,142],{"style":75},[69,667,668,670,673,676],{"class":71,"style":72},[69,669,131],{"style":75},[69,671,672],{"style":108},"pluginZod",[69,674,675],{"style":79},"()",[69,677,142],{"style":75},[69,679,680,682,685,687],{"class":71,"style":72},[69,681,131],{"style":75},[69,683,684],{"style":108},"pluginFaker",[69,686,675],{"style":79},[69,688,142],{"style":75},[69,690,691,693,696,698,700,702,704,706,709,711,714,716,719,721,723,725],{"class":71,"style":72},[69,692,131],{"style":75},[69,694,695],{"style":108},"pluginMsw",[69,697,554],{"style":79},[69,699,625],{"style":79},[69,701,123],{"style":75},[69,703,630],{"style":93},[69,705,31],{"style":75},[69,707,708],{"style":79},"parser",[69,710,123],{"style":75},[69,712,713],{"style":93},"'faker'",[69,715,31],{"style":75},[69,717,718],{"style":79},"handlers",[69,720,123],{"style":75},[69,722,661],{"style":79},[69,724,360],{"style":79},[69,726,142],{"style":75},[69,728,729,731,734],{"class":71,"style":72},[69,730,117],{"style":75},[69,732,733],{"style":79},"]",[69,735,142],{"style":75},[69,737,738],{"class":71,"style":72},[69,739,360],{"style":79},[48,741,743],{"id":742},"what-maps-to-what","What maps to what",[745,746,748],"h3",{"id":747},"config-options","Config options",[750,751,752,764],"table",{},[753,754,755],"thead",{},[756,757,758,761],"tr",{},[759,760,17],"th",{},[759,762,763],{},"Kubb",[765,766,767,782,795,810,827,849,866,880,893],"tbody",{},[756,768,769,775],{},[770,771,772],"td",{},[28,773,774],{},"output.schemas",[770,776,777],{},[14,778,780],{"href":779},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-ts",[28,781,585],{},[756,783,784,788],{},[770,785,786],{},[28,787,34],{},[770,789,790],{},[14,791,793],{"href":792},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch",[28,794,620],{},[756,796,797,802],{},[770,798,799],{},[28,800,801],{},"httpClient: 'axios'",[770,803,804],{},[14,805,807],{"href":806},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios",[28,808,809],{},"pluginAxios",[756,811,812,817],{},[770,813,814],{},[28,815,816],{},"output.baseUrl",[770,818,819,824,825],{},[14,820,822],{"href":821},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch\u002Foptions#baseurl",[28,823,625],{}," on ",[28,826,620],{},[756,828,829,834],{},[770,830,831],{},[28,832,833],{},"mode: 'tags-split'",[770,835,836,842,843,845,846,848],{},[14,837,839],{"href":838},"\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#group",[28,840,841],{},"group: { type: 'tag' }"," on each plugin. It needs directory output, so remove the ",[28,844,149],{}," option from ",[28,847,585],{}," first",[756,850,851,857],{},[770,852,853,854],{},"A custom ",[28,855,856],{},"mutator",[770,858,859,862,863],{},[28,860,861],{},"client.setConfig()"," and ",[28,864,865],{},"client.interceptors",[756,867,868,872],{},[770,869,870],{},[28,871,30],{},[770,873,874],{},[14,875,877],{"href":876},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-react-query\u002Foptions#hooks",[28,878,879],{},"pluginReactQuery({ hooks: true })",[756,881,882,886],{},[770,883,884],{},[28,885,41],{},[770,887,888],{},[14,889,891],{"href":890},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-zod",[28,892,672],{},[756,894,895,899],{},[770,896,897],{},[28,898,37],{},[770,900,901,862,906],{},[14,902,904],{"href":903},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-msw",[28,905,695],{},[14,907,909],{"href":908},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-faker",[28,910,684],{},[745,912,914],{"id":913},"generated-code","Generated code",[750,916,917,925],{},[753,918,919],{},[756,920,921,923],{},[759,922,17],{},[759,924,763],{},[765,926,927,945,960,972,984,996,1009,1021,1032],{},[756,928,929,938],{},[770,930,931,934,935],{},[28,932,933],{},"Pet"," from ",[28,936,937],{},".\u002Fapi\u002Fmodel",[770,939,940,934,942],{},[28,941,933],{},[28,943,944],{},".\u002Fgen\u002Ftypes",[756,946,947,952],{},[770,948,949],{},[28,950,951],{},"PetStatus",[770,953,954,862,957],{},[28,955,956],{},"petStatusEnum",[28,958,959],{},"PetStatusEnumKey",[756,961,962,967],{},[770,963,964],{},[28,965,966],{},"getPetById(1)",[770,968,969],{},[28,970,971],{},"getPetById({ path: { petId: 1 } })",[756,973,974,979],{},[770,975,976],{},[28,977,978],{},"useGetPetById(1)",[770,980,981],{},[28,982,983],{},"useGetPetById({ path: { petId: 1 } })",[756,985,986,991],{},[770,987,988],{},[28,989,990],{},"mutate({ data: pet })",[770,992,993],{},[28,994,995],{},"mutate({ body: pet })",[756,997,998,1004],{},[770,999,1000,1003],{},[28,1001,1002],{},"GetPetByIdResponse"," (Zod)",[770,1005,1006],{},[28,1007,1008],{},"petSchema",[756,1010,1011,1016],{},[770,1012,1013],{},[28,1014,1015],{},"getGetPetByIdMockHandler()",[770,1017,1018],{},[28,1019,1020],{},"getPetByIdHandler()",[756,1022,1023,1028],{},[770,1024,1025],{},[28,1026,1027],{},"getPetMock()",[770,1029,1030],{},[28,1031,718],{},[756,1033,1034,1039],{},[770,1035,1036],{},[28,1037,1038],{},"getGetPetByIdResponseMock()",[770,1040,1041],{},[28,1042,1043],{},"createPet()",[1045,1046,1048,1052,1074,1222,1229,1352,1370,1458,1467,1594,1597,1601,1608,1686,1701,1791,1811,2065,2079,2135,2142,2146,2169,2244,2258,2279,2285,2320,2553,2557,2578,2653,2662,2815,2819,2836,2935,2948,3051,3056,3321,3331,3335],"steps",{"level":1047},"2",[48,1049,1051],{"id":1050},"generate-the-types","Generate the types",[10,1053,1054,1055,1058,1059,1062,1063,1066,1067,1070,1071,46],{},"Create this config. It writes every type into ",[28,1056,1057],{},"src\u002Fgen\u002Ftypes.ts",". ",[28,1060,1061],{},"integerType: 'number'"," keeps ",[28,1064,1065],{},"int64"," as ",[28,1068,1069],{},"number",", as orval does. Kubb's default is ",[28,1072,1073],{},"bigint",[59,1075,1077],{"language":61,"filename":363,"code":1076,"class":64},"import { defineConfig } from 'kubb\u002Fconfig'\nimport { adapterOas } from '@kubb\u002Fadapter-oas'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\n\nexport default defineConfig({\n input: '.\u002Fopenapi.yaml',\n output: { path: '.\u002Fsrc\u002Fgen' },\n adapter: adapterOas({ integerType: 'number' }),\n plugins: [pluginTs({ output: { path: 'types.ts' } })],\n})",[28,1078,1079,95,1093,95,1107,95,1121,95,1123,95,1133,95,1145,95,1165,95,1187,95,1218],{"class":67},[69,1080,1081,1083,1085,1087,1089,1091],{"class":71,"style":72},[69,1082,76],{"style":75},[69,1084,80],{"style":79},[69,1086,84],{"style":83},[69,1088,87],{"style":79},[69,1090,90],{"style":75},[69,1092,381],{"style":93},[69,1094,1095,1097,1099,1101,1103,1105],{"class":71,"style":72},[69,1096,76],{"style":75},[69,1098,80],{"style":79},[69,1100,390],{"style":83},[69,1102,87],{"style":79},[69,1104,90],{"style":75},[69,1106,397],{"style":93},[69,1108,1109,1111,1113,1115,1117,1119],{"class":71,"style":72},[69,1110,76],{"style":75},[69,1112,80],{"style":79},[69,1114,470],{"style":83},[69,1116,87],{"style":79},[69,1118,90],{"style":75},[69,1120,477],{"style":93},[69,1122],{"class":71,"style":72},[69,1124,1125,1127,1129,1131],{"class":71,"style":72},[69,1126,102],{"style":75},[69,1128,105],{"style":75},[69,1130,109],{"style":108},[69,1132,112],{"style":79},[69,1134,1135,1137,1139,1141,1143],{"class":71,"style":72},[69,1136,117],{"style":79},[69,1138,134],{"style":79},[69,1140,123],{"style":75},[69,1142,139],{"style":93},[69,1144,142],{"style":75},[69,1146,1147,1149,1151,1153,1155,1157,1159,1161,1163],{"class":71,"style":72},[69,1148,117],{"style":75},[69,1150,149],{"style":79},[69,1152,123],{"style":75},[69,1154,80],{"style":79},[69,1156,530],{"style":79},[69,1158,123],{"style":75},[69,1160,535],{"style":93},[69,1162,245],{"style":79},[69,1164,142],{"style":75},[69,1166,1167,1169,1171,1173,1175,1177,1179,1181,1183,1185],{"class":71,"style":72},[69,1168,117],{"style":75},[69,1170,546],{"style":79},[69,1172,123],{"style":75},[69,1174,551],{"style":108},[69,1176,554],{"style":79},[69,1178,557],{"style":79},[69,1180,123],{"style":75},[69,1182,562],{"style":93},[69,1184,360],{"style":79},[69,1186,142],{"style":75},[69,1188,1189,1191,1193,1195,1197,1199,1201,1203,1205,1207,1209,1211,1213,1216],{"class":71,"style":72},[69,1190,117],{"style":75},[69,1192,573],{"style":79},[69,1194,123],{"style":75},[69,1196,578],{"style":79},[69,1198,585],{"style":108},[69,1200,554],{"style":79},[69,1202,149],{"style":79},[69,1204,123],{"style":75},[69,1206,80],{"style":79},[69,1208,530],{"style":79},[69,1210,123],{"style":75},[69,1212,600],{"style":93},[69,1214,1215],{"style":79},"} })]",[69,1217,142],{"style":75},[69,1219,1220],{"class":71,"style":72},[69,1221,360],{"style":79},[10,1223,1224,1225,1228],{},"Install the packages it imports. ",[28,1226,1227],{},"kubb add"," needs the config to exist, and leaves a plugin that is already in it unchanged:",[56,1230,1232,1263,1288,1309,1330],{"sync":1231},"package-manager",[59,1233,1237],{"language":1234,"filename":1235,"code":1236,"class":64},"shell","kubb","npm install -D kubb\nkubb add adapter-oas\nkubb add plugin-ts",[28,1238,1240,95,1248,95,1256],{"class":1239},"language-shell",[69,1241,1242,1245],{"class":71,"style":72},[69,1243,1244],{"style":108},"npm ",[69,1246,1247],{"style":83},"install -D kubb",[69,1249,1250,1253],{"class":71,"style":72},[69,1251,1252],{"style":108},"kubb ",[69,1254,1255],{"style":83},"add adapter-oas",[69,1257,1258,1260],{"class":71,"style":72},[69,1259,1252],{"style":108},[69,1261,1262],{"style":83},"add plugin-ts",[59,1264,1267],{"language":1234,"filename":1265,"code":1266,"class":64},"pnpm","pnpm add -D kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[28,1268,1269],{"class":1239},[69,1270,1271,1274,1277,1280,1283,1285],{"class":71,"style":72},[69,1272,1273],{"style":108},"pnpm ",[69,1275,1276],{"style":83},"add -D kubb ",[69,1278,1279],{"style":83},"@",[69,1281,1282],{"style":83},"kubb\u002Fadapter-oas ",[69,1284,1279],{"style":83},[69,1286,1287],{"style":83},"kubb\u002Fplugin-ts",[59,1289,1292],{"language":1234,"filename":1290,"code":1291,"class":64},"npm","npm install -D kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[28,1293,1294],{"class":1239},[69,1295,1296,1298,1301,1303,1305,1307],{"class":71,"style":72},[69,1297,1244],{"style":108},[69,1299,1300],{"style":83},"install -D kubb ",[69,1302,1279],{"style":83},[69,1304,1282],{"style":83},[69,1306,1279],{"style":83},[69,1308,1287],{"style":83},[59,1310,1313],{"language":1234,"filename":1311,"code":1312,"class":64},"yarn","yarn add -D kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[28,1314,1315],{"class":1239},[69,1316,1317,1320,1322,1324,1326,1328],{"class":71,"style":72},[69,1318,1319],{"style":108},"yarn ",[69,1321,1276],{"style":83},[69,1323,1279],{"style":83},[69,1325,1282],{"style":83},[69,1327,1279],{"style":83},[69,1329,1287],{"style":83},[59,1331,1334],{"language":1234,"filename":1332,"code":1333,"class":64},"bun","bun add -d kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[28,1335,1336],{"class":1239},[69,1337,1338,1341,1344,1346,1348,1350],{"class":71,"style":72},[69,1339,1340],{"style":108},"bun ",[69,1342,1343],{"style":83},"add -d kubb ",[69,1345,1279],{"style":83},[69,1347,1282],{"style":83},[69,1349,1279],{"style":83},[69,1351,1287],{"style":83},[10,1353,1354,1355,1358,1359,1362,1363,1365,1366,1369],{},"Change your ",[28,1356,1357],{},"generate"," script to ",[28,1360,1361],{},"kubb generate"," and run it. Leave ",[28,1364,45],{}," in place until the last step, because the rest of the app still imports it. Those files stop following the spec once orval no longer runs. If you pause before the last step, use ",[28,1367,1368],{},"orval && kubb generate"," as the script:",[56,1371,1372,1417],{},[59,1373,1377],{"language":1374,"filename":1375,"code":1376,"class":64},"json","Before","{\n \"scripts\": {\n \"generate\": \"orval\"\n }\n}",[28,1378,1380,95,1384,95,1395,95,1407,95,1413],{"class":1379},"language-json",[69,1381,1382],{"class":71,"style":72},[69,1383,126],{"style":79},[69,1385,1386,1388,1391,1393],{"class":71,"style":72},[69,1387,117],{"style":79},[69,1389,1390],{"style":79},"\"scripts\"",[69,1392,123],{"style":75},[69,1394,126],{"style":79},[69,1396,1397,1399,1402,1404],{"class":71,"style":72},[69,1398,131],{"style":79},[69,1400,1401],{"style":79},"\"generate\"",[69,1403,123],{"style":75},[69,1405,1406],{"style":93},"\"orval\"",[69,1408,1409,1411],{"class":71,"style":72},[69,1410,117],{"style":93},[69,1412,245],{"style":79},[69,1414,1415],{"class":71,"style":72},[69,1416,245],{"style":79},[59,1418,1421],{"language":1374,"filename":1419,"code":1420,"class":64},"After","{\n \"scripts\": {\n \"generate\": \"kubb generate\"\n }\n}",[28,1422,1423,95,1427,95,1437,95,1448,95,1454],{"class":1379},[69,1424,1425],{"class":71,"style":72},[69,1426,126],{"style":79},[69,1428,1429,1431,1433,1435],{"class":71,"style":72},[69,1430,117],{"style":79},[69,1432,1390],{"style":79},[69,1434,123],{"style":75},[69,1436,126],{"style":79},[69,1438,1439,1441,1443,1445],{"class":71,"style":72},[69,1440,131],{"style":79},[69,1442,1401],{"style":79},[69,1444,123],{"style":75},[69,1446,1447],{"style":93},"\"kubb generate\"",[69,1449,1450,1452],{"class":71,"style":72},[69,1451,117],{"style":93},[69,1453,245],{"style":79},[69,1455,1456],{"class":71,"style":72},[69,1457,245],{"style":79},[10,1459,1460,1461,1463,1464,1466],{},"Then replace the model imports. Kubb names an enum's values ",[28,1462,956],{}," and its type ",[28,1465,959],{},":",[56,1468,1469,1532],{},[59,1470,1472],{"language":61,"filename":17,"code":1471,"class":64},"import type { Pet } from '.\u002Fapi\u002Fmodel'\nimport { PetStatus } from '.\u002Fapi\u002Fmodel'\n\nconst status: PetStatus = PetStatus.available",[28,1473,1474,95,1493,95,1508,95,1510],{"class":67},[69,1475,1476,1478,1481,1483,1486,1488,1490],{"class":71,"style":72},[69,1477,76],{"style":75},[69,1479,1480],{"style":83},"type ",[69,1482,80],{"style":79},[69,1484,1485],{"style":108},"Pet ",[69,1487,87],{"style":79},[69,1489,90],{"style":75},[69,1491,1492],{"style":93},"'.\u002Fapi\u002Fmodel'",[69,1494,1495,1497,1499,1502,1504,1506],{"class":71,"style":72},[69,1496,76],{"style":75},[69,1498,80],{"style":79},[69,1500,1501],{"style":108},"PetStatus ",[69,1503,87],{"style":79},[69,1505,90],{"style":75},[69,1507,1492],{"style":93},[69,1509],{"class":71,"style":72},[69,1511,1512,1515,1518,1520,1522,1525,1527,1529],{"class":71,"style":72},[69,1513,1514],{"style":75},"const ",[69,1516,1517],{"style":83},"status",[69,1519,123],{"style":83},[69,1521,1501],{"style":108},[69,1523,1524],{"style":75},"= ",[69,1526,951],{"style":108},[69,1528,46],{"style":75},[69,1530,1531],{"style":79},"available",[59,1533,1535],{"language":61,"filename":763,"code":1534,"class":64},"import type { Pet, PetStatusEnumKey } from '.\u002Fgen\u002Ftypes'\nimport { petStatusEnum } from '.\u002Fgen\u002Ftypes'\n\nconst status: PetStatusEnumKey = petStatusEnum.available",[28,1536,1537,95,1559,95,1574,95,1576],{"class":67},[69,1538,1539,1541,1543,1545,1547,1549,1552,1554,1556],{"class":71,"style":72},[69,1540,76],{"style":75},[69,1542,1480],{"style":83},[69,1544,80],{"style":79},[69,1546,933],{"style":108},[69,1548,31],{"style":75},[69,1550,1551],{"style":108},"PetStatusEnumKey ",[69,1553,87],{"style":79},[69,1555,90],{"style":75},[69,1557,1558],{"style":93},"'.\u002Fgen\u002Ftypes'",[69,1560,1561,1563,1565,1568,1570,1572],{"class":71,"style":72},[69,1562,76],{"style":75},[69,1564,80],{"style":79},[69,1566,1567],{"style":83},"petStatusEnum ",[69,1569,87],{"style":79},[69,1571,90],{"style":75},[69,1573,1558],{"style":93},[69,1575],{"class":71,"style":72},[69,1577,1578,1580,1582,1584,1586,1588,1590,1592],{"class":71,"style":72},[69,1579,1514],{"style":75},[69,1581,1517],{"style":83},[69,1583,123],{"style":83},[69,1585,1551],{"style":108},[69,1587,1524],{"style":75},[69,1589,956],{"style":83},[69,1591,46],{"style":75},[69,1593,1531],{"style":79},[10,1595,1596],{},"Run your type check and fix the imports it reports.",[48,1598,1600],{"id":1599},"replace-the-client","Replace the client",[10,1602,1603,1604,1607],{},"Add ",[28,1605,1606],{},"@kubb\u002Fplugin-fetch",". It writes one function per operation, and the app needs no client package:",[56,1609,1610,1622,1639,1655,1670],{"sync":1231},[59,1611,1613],{"language":1234,"filename":1235,"code":1612,"class":64},"kubb add plugin-fetch",[28,1614,1615],{"class":1239},[69,1616,1617,1619],{"class":71,"style":72},[69,1618,1252],{"style":108},[69,1620,1621],{"style":83},"add plugin-fetch",[59,1623,1625],{"language":1234,"filename":1265,"code":1624,"class":64},"pnpm add -D @kubb\u002Fplugin-fetch",[28,1626,1627],{"class":1239},[69,1628,1629,1631,1634,1636],{"class":71,"style":72},[69,1630,1273],{"style":108},[69,1632,1633],{"style":83},"add -D ",[69,1635,1279],{"style":83},[69,1637,1638],{"style":83},"kubb\u002Fplugin-fetch",[59,1640,1642],{"language":1234,"filename":1290,"code":1641,"class":64},"npm install -D @kubb\u002Fplugin-fetch",[28,1643,1644],{"class":1239},[69,1645,1646,1648,1651,1653],{"class":71,"style":72},[69,1647,1244],{"style":108},[69,1649,1650],{"style":83},"install -D ",[69,1652,1279],{"style":83},[69,1654,1638],{"style":83},[59,1656,1658],{"language":1234,"filename":1311,"code":1657,"class":64},"yarn add -D @kubb\u002Fplugin-fetch",[28,1659,1660],{"class":1239},[69,1661,1662,1664,1666,1668],{"class":71,"style":72},[69,1663,1319],{"style":108},[69,1665,1633],{"style":83},[69,1667,1279],{"style":83},[69,1669,1638],{"style":83},[59,1671,1673],{"language":1234,"filename":1332,"code":1672,"class":64},"bun add -d @kubb\u002Fplugin-fetch",[28,1674,1675],{"class":1239},[69,1676,1677,1679,1682,1684],{"class":71,"style":72},[69,1678,1340],{"style":108},[69,1680,1681],{"style":83},"add -d ",[69,1683,1279],{"style":83},[69,1685,1638],{"style":83},[10,1687,1688,1690,1691,1694,1695,1697,1698,1700],{},[28,1689,1227],{}," adds ",[28,1692,1693],{},"pluginFetch()"," to ",[28,1696,573],{},". With a package manager, add the import and the plugin yourself. Then set its options, with your API's URL as ",[28,1699,625],{},". The Petstore URL is an example:",[59,1702,1704],{"language":61,"filename":363,"code":1703,"class":64},"import { pluginFetch } from '@kubb\u002Fplugin-fetch'\n\n\u002F\u002F ...\nplugins: [\n pluginTs({ output: { path: 'types.ts' } }),\n pluginFetch({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', throwOnErrorDefault: false }),\n],",[28,1705,1706,95,1720,95,1722,95,1727,95,1735,95,1759,95,1785],{"class":67},[69,1707,1708,1710,1712,1714,1716,1718],{"class":71,"style":72},[69,1709,76],{"style":75},[69,1711,80],{"style":79},[69,1713,422],{"style":83},[69,1715,87],{"style":79},[69,1717,90],{"style":75},[69,1719,429],{"style":93},[69,1721],{"class":71,"style":72},[69,1723,1724],{"class":71,"style":72},[69,1725,1726],{"style":612},"\u002F\u002F ...",[69,1728,1729,1731,1733],{"class":71,"style":72},[69,1730,573],{"style":83},[69,1732,123],{"style":75},[69,1734,578],{"style":79},[69,1736,1737,1739,1741,1743,1745,1747,1749,1751,1753,1755,1757],{"class":71,"style":72},[69,1738,117],{"style":79},[69,1740,585],{"style":108},[69,1742,554],{"style":79},[69,1744,149],{"style":79},[69,1746,123],{"style":75},[69,1748,80],{"style":79},[69,1750,530],{"style":79},[69,1752,123],{"style":75},[69,1754,600],{"style":93},[69,1756,603],{"style":79},[69,1758,142],{"style":75},[69,1760,1761,1763,1765,1767,1769,1771,1773,1775,1777,1779,1781,1783],{"class":71,"style":72},[69,1762,117],{"style":75},[69,1764,620],{"style":108},[69,1766,554],{"style":79},[69,1768,625],{"style":79},[69,1770,123],{"style":75},[69,1772,630],{"style":93},[69,1774,31],{"style":75},[69,1776,635],{"style":79},[69,1778,123],{"style":75},[69,1780,640],{"style":79},[69,1782,360],{"style":79},[69,1784,142],{"style":75},[69,1786,1787,1789],{"class":71,"style":72},[69,1788,733],{"style":79},[69,1790,142],{"style":75},[10,1792,1793,1796,1797,1800,1801,1804,1805,1807,1808,1810],{},[28,1794,1795],{},"throwOnErrorDefault: false"," keeps the behavior of orval's fetch client: an error status resolves instead of throwing. orval puts the error body in ",[28,1798,1799],{},"data",". Kubb puts it in ",[28,1802,1803],{},"error"," and leaves ",[28,1806,1799],{}," undefined. Run ",[28,1809,1361],{},", then replace each call:",[56,1812,1813,1907],{},[59,1814,1816],{"language":61,"filename":17,"code":1815,"class":64},"import { getPetById } from '.\u002Fapi\u002Fpet\u002Fpet'\n\nconst { data, status } = await getPetById(1, {\n headers: { Authorization: `Bearer ${token}` },\n})",[28,1817,1818,95,1834,95,1836,95,1869,95,1903],{"class":67},[69,1819,1820,1822,1824,1827,1829,1831],{"class":71,"style":72},[69,1821,76],{"style":75},[69,1823,80],{"style":79},[69,1825,1826],{"style":83},"getPetById ",[69,1828,87],{"style":79},[69,1830,90],{"style":75},[69,1832,1833],{"style":93},"'.\u002Fapi\u002Fpet\u002Fpet'",[69,1835],{"class":71,"style":72},[69,1837,1838,1840,1842,1844,1846,1849,1851,1853,1856,1859,1862,1865,1867],{"class":71,"style":72},[69,1839,1514],{"style":75},[69,1841,80],{"style":79},[69,1843,1799],{"style":83},[69,1845,31],{"style":75},[69,1847,1848],{"style":83},"status ",[69,1850,87],{"style":79},[69,1852,1524],{"style":75},[69,1854,1855],{"style":75},"await ",[69,1857,1858],{"style":108},"getPetById",[69,1860,1861],{"style":79},"(",[69,1863,1864],{"style":79},"1",[69,1866,31],{"style":75},[69,1868,126],{"style":79},[69,1870,1871,1873,1876,1878,1880,1883,1885,1888,1891,1894,1896,1899,1901],{"class":71,"style":72},[69,1872,117],{"style":79},[69,1874,1875],{"style":79},"headers",[69,1877,123],{"style":75},[69,1879,80],{"style":79},[69,1881,1882],{"style":79},"Authorization",[69,1884,123],{"style":75},[69,1886,1887],{"style":93},"`Bearer ",[69,1889,1890],{"style":83},"${",[69,1892,1893],{"style":83},"token",[69,1895,245],{"style":83},[69,1897,1898],{"style":93},"` ",[69,1900,245],{"style":79},[69,1902,142],{"style":75},[69,1904,1905],{"class":71,"style":72},[69,1906,360],{"style":79},[59,1908,1910],{"language":61,"filename":763,"code":1909,"class":64},"import { client } from '.\u002Fgen\u002F.kubb\u002Fclient'\nimport { getPetById } from '.\u002Fgen\u002Fclients\u002FgetPetById'\n\nclient.interceptors.request.use((request) => {\n request.headers['Authorization'] = `Bearer ${token}`\n return request\n})\n\nconst { data, error, status } = await getPetById({ path: { petId: 1 } })",[28,1911,1912,95,1928,95,1943,95,1945,95,1977,95,2008,95,2017,95,2021,95,2023],{"class":67},[69,1913,1914,1916,1918,1921,1923,1925],{"class":71,"style":72},[69,1915,76],{"style":75},[69,1917,80],{"style":79},[69,1919,1920],{"style":83},"client ",[69,1922,87],{"style":79},[69,1924,90],{"style":75},[69,1926,1927],{"style":93},"'.\u002Fgen\u002F.kubb\u002Fclient'",[69,1929,1930,1932,1934,1936,1938,1940],{"class":71,"style":72},[69,1931,76],{"style":75},[69,1933,80],{"style":79},[69,1935,1826],{"style":83},[69,1937,87],{"style":79},[69,1939,90],{"style":75},[69,1941,1942],{"style":93},"'.\u002Fgen\u002Fclients\u002FgetPetById'",[69,1944],{"class":71,"style":72},[69,1946,1947,1949,1951,1954,1956,1959,1961,1964,1967,1969,1972,1975],{"class":71,"style":72},[69,1948,203],{"style":83},[69,1950,46],{"style":75},[69,1952,1953],{"style":79},"interceptors",[69,1955,46],{"style":75},[69,1957,1958],{"style":79},"request",[69,1960,46],{"style":75},[69,1962,1963],{"style":108},"use",[69,1965,1966],{"style":79},"((",[69,1968,1958],{"style":83},[69,1970,1971],{"style":79},") ",[69,1973,1974],{"style":75},"=> ",[69,1976,126],{"style":79},[69,1978,1979,1981,1983,1985,1987,1989,1992,1995,1997,1999,2001,2003,2005],{"class":71,"style":72},[69,1980,117],{"style":79},[69,1982,1958],{"style":83},[69,1984,46],{"style":75},[69,1986,1875],{"style":79},[69,1988,578],{"style":79},[69,1990,1991],{"style":93},"'Authorization'",[69,1993,1994],{"style":79},"] ",[69,1996,1524],{"style":75},[69,1998,1887],{"style":93},[69,2000,1890],{"style":83},[69,2002,1893],{"style":83},[69,2004,245],{"style":83},[69,2006,2007],{"style":93},"`",[69,2009,2010,2012,2015],{"class":71,"style":72},[69,2011,117],{"style":93},[69,2013,2014],{"style":75},"return ",[69,2016,1958],{"style":83},[69,2018,2019],{"class":71,"style":72},[69,2020,360],{"style":79},[69,2022],{"class":71,"style":72},[69,2024,2025,2027,2029,2031,2033,2035,2037,2039,2041,2043,2045,2047,2049,2051,2053,2055,2058,2060,2063],{"class":71,"style":72},[69,2026,1514],{"style":75},[69,2028,80],{"style":79},[69,2030,1799],{"style":83},[69,2032,31],{"style":75},[69,2034,1803],{"style":83},[69,2036,31],{"style":75},[69,2038,1848],{"style":83},[69,2040,87],{"style":79},[69,2042,1524],{"style":75},[69,2044,1855],{"style":75},[69,2046,1858],{"style":108},[69,2048,554],{"style":79},[69,2050,530],{"style":79},[69,2052,123],{"style":75},[69,2054,80],{"style":79},[69,2056,2057],{"style":79},"petId",[69,2059,123],{"style":75},[69,2061,2062],{"style":79},"1 ",[69,2064,603],{"style":79},[10,2066,2067,2068,2070,2071,2074,2075,2078],{},"The interceptor sends the header on every request, like a custom ",[28,2069,856],{}," that sets it. To send a credential only to operations that declare a security scheme, set ",[28,2072,2073],{},"auth"," instead. It gets each scheme, and its return value goes where that scheme says, such as the ",[28,2076,2077],{},"api_key"," header:",[59,2080,2082],{"language":61,"code":2081,"class":64},"client.setConfig({ auth: (scheme) => (scheme.type === 'apiKey' ? apiKey : token) })",[28,2083,2084],{"class":67},[69,2085,2086,2088,2090,2093,2095,2097,2099,2101,2104,2106,2108,2110,2112,2114,2116,2119,2122,2125,2128,2130,2132],{"class":71,"style":72},[69,2087,203],{"style":83},[69,2089,46],{"style":75},[69,2091,2092],{"style":108},"setConfig",[69,2094,554],{"style":79},[69,2096,2073],{"style":79},[69,2098,123],{"style":75},[69,2100,1861],{"style":79},[69,2102,2103],{"style":83},"scheme",[69,2105,1971],{"style":79},[69,2107,1974],{"style":75},[69,2109,1861],{"style":79},[69,2111,2103],{"style":83},[69,2113,46],{"style":75},[69,2115,1480],{"style":79},[69,2117,2118],{"style":75},"=== ",[69,2120,2121],{"style":93},"'apiKey' ",[69,2123,2124],{"style":75},"? ",[69,2126,2127],{"style":83},"apiKey ",[69,2129,123],{"style":75},[69,2131,1893],{"style":83},[69,2133,2134],{"style":79},") })",[10,2136,2137,2141],{},[14,2138,2140],{"href":2139},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch\u002Fguides\u002Fconfigure-requests","Configure requests"," covers both.",[48,2143,2145],{"id":2144},"replace-the-query-hooks","Replace the query hooks",[10,2147,1603,2148,2154,2155,934,2157,2159,2160,2163,2164,2166,2167,1466],{},[14,2149,2151],{"href":2150},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-react-query",[28,2152,2153],{},"@kubb\u002Fplugin-react-query",". With a package manager, also import ",[28,2156,651],{},[28,2158,2153],{}," and add ",[28,2161,2162],{},"pluginReactQuery()"," after ",[28,2165,620],{}," in ",[28,2168,573],{},[56,2170,2171,2183,2199,2214,2229],{"sync":1231},[59,2172,2174],{"language":1234,"filename":1235,"code":2173,"class":64},"kubb add plugin-react-query",[28,2175,2176],{"class":1239},[69,2177,2178,2180],{"class":71,"style":72},[69,2179,1252],{"style":108},[69,2181,2182],{"style":83},"add plugin-react-query",[59,2184,2186],{"language":1234,"filename":1265,"code":2185,"class":64},"pnpm add -D @kubb\u002Fplugin-react-query",[28,2187,2188],{"class":1239},[69,2189,2190,2192,2194,2196],{"class":71,"style":72},[69,2191,1273],{"style":108},[69,2193,1633],{"style":83},[69,2195,1279],{"style":83},[69,2197,2198],{"style":83},"kubb\u002Fplugin-react-query",[59,2200,2202],{"language":1234,"filename":1290,"code":2201,"class":64},"npm install -D @kubb\u002Fplugin-react-query",[28,2203,2204],{"class":1239},[69,2205,2206,2208,2210,2212],{"class":71,"style":72},[69,2207,1244],{"style":108},[69,2209,1650],{"style":83},[69,2211,1279],{"style":83},[69,2213,2198],{"style":83},[59,2215,2217],{"language":1234,"filename":1311,"code":2216,"class":64},"yarn add -D @kubb\u002Fplugin-react-query",[28,2218,2219],{"class":1239},[69,2220,2221,2223,2225,2227],{"class":71,"style":72},[69,2222,1319],{"style":108},[69,2224,1633],{"style":83},[69,2226,1279],{"style":83},[69,2228,2198],{"style":83},[59,2230,2232],{"language":1234,"filename":1332,"code":2231,"class":64},"bun add -d @kubb\u002Fplugin-react-query",[28,2233,2234],{"class":1239},[69,2235,2236,2238,2240,2242],{"class":71,"style":72},[69,2237,1340],{"style":108},[69,2239,1681],{"style":83},[69,2241,1279],{"style":83},[69,2243,2198],{"style":83},[10,2245,2246,2247,2250,2251,862,2254,2257],{},"Set ",[28,2248,2249],{},"hooks: true"," to get ",[28,2252,2253],{},"useGetPetById",[28,2255,2256],{},"useAddPet",", as orval writes them. Without it, the plugin writes only the query and mutation options:",[59,2259,2261],{"language":61,"filename":363,"code":2260,"class":64},"pluginReactQuery({ hooks: true }),",[28,2262,2263],{"class":67},[69,2264,2265,2267,2269,2271,2273,2275,2277],{"class":71,"style":72},[69,2266,651],{"style":108},[69,2268,554],{"style":79},[69,2270,656],{"style":79},[69,2272,123],{"style":75},[69,2274,661],{"style":79},[69,2276,360],{"style":79},[69,2278,142],{"style":75},[10,2280,2281,2282,2284],{},"Run ",[28,2283,1361],{},", then replace each hook. Two things differ from hooks on orval's fetch client:",[2286,2287,2288,2298],"ul",{},[2289,2290,2291,2292,2294,2295,46],"li",{},"A hook's ",[28,2293,1799],{}," holds the response body, not ",[28,2296,2297],{},"{ data, status, headers }",[2289,2299,2300,2301,2303,2304,2307,2308,2310,2311,2313,2314,2316,2317,2319],{},"An error status goes to the hook's ",[28,2302,1803],{}," and to ",[28,2305,2306],{},"onError",", whatever ",[28,2309,635],{}," says. With orval it resolves as ",[28,2312,1799],{},", so move any ",[28,2315,1517],{}," check on ",[28,2318,1799],{}," there.",[56,2321,2322,2436],{},[59,2323,2325],{"language":61,"filename":17,"code":2324,"class":64},"import { useAddPet, useGetPetById } from '.\u002Fapi\u002Fpet\u002Fpet'\n\nconst { data } = useGetPetById(1)\nconst pet = data?.data\n\nconst { mutate } = useAddPet()\nmutate({ data: { name: 'Rex', photoUrls: [] } })",[28,2326,2327,95,2346,95,2348,95,2370,95,2386,95,2388,95,2405],{"class":67},[69,2328,2329,2331,2333,2335,2337,2340,2342,2344],{"class":71,"style":72},[69,2330,76],{"style":75},[69,2332,80],{"style":79},[69,2334,2256],{"style":83},[69,2336,31],{"style":75},[69,2338,2339],{"style":83},"useGetPetById ",[69,2341,87],{"style":79},[69,2343,90],{"style":75},[69,2345,1833],{"style":93},[69,2347],{"class":71,"style":72},[69,2349,2350,2352,2354,2357,2359,2361,2363,2365,2367],{"class":71,"style":72},[69,2351,1514],{"style":75},[69,2353,80],{"style":79},[69,2355,2356],{"style":83},"data ",[69,2358,87],{"style":79},[69,2360,1524],{"style":75},[69,2362,2253],{"style":108},[69,2364,1861],{"style":79},[69,2366,1864],{"style":79},[69,2368,2369],{"style":79},")",[69,2371,2372,2374,2377,2379,2381,2384],{"class":71,"style":72},[69,2373,1514],{"style":75},[69,2375,2376],{"style":83},"pet ",[69,2378,1524],{"style":75},[69,2380,1799],{"style":83},[69,2382,2383],{"style":75},"?.",[69,2385,1799],{"style":79},[69,2387],{"class":71,"style":72},[69,2389,2390,2392,2394,2397,2399,2401,2403],{"class":71,"style":72},[69,2391,1514],{"style":75},[69,2393,80],{"style":79},[69,2395,2396],{"style":83},"mutate ",[69,2398,87],{"style":79},[69,2400,1524],{"style":75},[69,2402,2256],{"style":108},[69,2404,675],{"style":79},[69,2406,2407,2410,2412,2414,2416,2418,2421,2423,2426,2428,2431,2433],{"class":71,"style":72},[69,2408,2409],{"style":108},"mutate",[69,2411,554],{"style":79},[69,2413,1799],{"style":79},[69,2415,123],{"style":75},[69,2417,80],{"style":79},[69,2419,2420],{"style":79},"name",[69,2422,123],{"style":75},[69,2424,2425],{"style":93},"'Rex'",[69,2427,31],{"style":75},[69,2429,2430],{"style":79},"photoUrls",[69,2432,123],{"style":75},[69,2434,2435],{"style":79},"[] } })",[59,2437,2439],{"language":61,"filename":763,"code":2438,"class":64},"import { useAddPet } from '.\u002Fgen\u002Fhooks\u002FuseAddPet'\nimport { useGetPetById } from '.\u002Fgen\u002Fhooks\u002FuseGetPetById'\n\nconst { data: pet } = useGetPetById({ path: { petId: 1 } })\n\nconst { mutate } = useAddPet()\nmutate({ body: { name: 'Rex', photoUrls: [] } })",[28,2440,2441,95,2457,95,2472,95,2474,95,2508,95,2510,95,2526],{"class":67},[69,2442,2443,2445,2447,2450,2452,2454],{"class":71,"style":72},[69,2444,76],{"style":75},[69,2446,80],{"style":79},[69,2448,2449],{"style":83},"useAddPet ",[69,2451,87],{"style":79},[69,2453,90],{"style":75},[69,2455,2456],{"style":93},"'.\u002Fgen\u002Fhooks\u002FuseAddPet'",[69,2458,2459,2461,2463,2465,2467,2469],{"class":71,"style":72},[69,2460,76],{"style":75},[69,2462,80],{"style":79},[69,2464,2339],{"style":83},[69,2466,87],{"style":79},[69,2468,90],{"style":75},[69,2470,2471],{"style":93},"'.\u002Fgen\u002Fhooks\u002FuseGetPetById'",[69,2473],{"class":71,"style":72},[69,2475,2476,2478,2480,2482,2484,2486,2488,2490,2492,2494,2496,2498,2500,2502,2504,2506],{"class":71,"style":72},[69,2477,1514],{"style":75},[69,2479,80],{"style":79},[69,2481,1799],{"style":79},[69,2483,123],{"style":75},[69,2485,2376],{"style":83},[69,2487,87],{"style":79},[69,2489,1524],{"style":75},[69,2491,2253],{"style":108},[69,2493,554],{"style":79},[69,2495,530],{"style":79},[69,2497,123],{"style":75},[69,2499,80],{"style":79},[69,2501,2057],{"style":79},[69,2503,123],{"style":75},[69,2505,2062],{"style":79},[69,2507,603],{"style":79},[69,2509],{"class":71,"style":72},[69,2511,2512,2514,2516,2518,2520,2522,2524],{"class":71,"style":72},[69,2513,1514],{"style":75},[69,2515,80],{"style":79},[69,2517,2396],{"style":83},[69,2519,87],{"style":79},[69,2521,1524],{"style":75},[69,2523,2256],{"style":108},[69,2525,675],{"style":79},[69,2527,2528,2530,2532,2535,2537,2539,2541,2543,2545,2547,2549,2551],{"class":71,"style":72},[69,2529,2409],{"style":108},[69,2531,554],{"style":79},[69,2533,2534],{"style":79},"body",[69,2536,123],{"style":75},[69,2538,80],{"style":79},[69,2540,2420],{"style":79},[69,2542,123],{"style":75},[69,2544,2425],{"style":93},[69,2546,31],{"style":75},[69,2548,2430],{"style":79},[69,2550,123],{"style":75},[69,2552,2435],{"style":79},[48,2554,2556],{"id":2555},"replace-the-zod-schemas","Replace the Zod schemas",[10,2558,1603,2559,2154,2564,934,2566,2159,2568,1694,2571,2573,2574,2577],{},[14,2560,2561],{"href":890},[28,2562,2563],{},"@kubb\u002Fplugin-zod",[28,2565,672],{},[28,2567,2563],{},[28,2569,2570],{},"pluginZod()",[28,2572,573],{},". The schemas need Zod 4, so upgrade ",[28,2575,2576],{},"zod"," first if the app is on Zod 3:",[56,2579,2580,2592,2608,2623,2638],{"sync":1231},[59,2581,2583],{"language":1234,"filename":1235,"code":2582,"class":64},"kubb add plugin-zod",[28,2584,2585],{"class":1239},[69,2586,2587,2589],{"class":71,"style":72},[69,2588,1252],{"style":108},[69,2590,2591],{"style":83},"add plugin-zod",[59,2593,2595],{"language":1234,"filename":1265,"code":2594,"class":64},"pnpm add -D @kubb\u002Fplugin-zod",[28,2596,2597],{"class":1239},[69,2598,2599,2601,2603,2605],{"class":71,"style":72},[69,2600,1273],{"style":108},[69,2602,1633],{"style":83},[69,2604,1279],{"style":83},[69,2606,2607],{"style":83},"kubb\u002Fplugin-zod",[59,2609,2611],{"language":1234,"filename":1290,"code":2610,"class":64},"npm install -D @kubb\u002Fplugin-zod",[28,2612,2613],{"class":1239},[69,2614,2615,2617,2619,2621],{"class":71,"style":72},[69,2616,1244],{"style":108},[69,2618,1650],{"style":83},[69,2620,1279],{"style":83},[69,2622,2607],{"style":83},[59,2624,2626],{"language":1234,"filename":1311,"code":2625,"class":64},"yarn add -D @kubb\u002Fplugin-zod",[28,2627,2628],{"class":1239},[69,2629,2630,2632,2634,2636],{"class":71,"style":72},[69,2631,1319],{"style":108},[69,2633,1633],{"style":83},[69,2635,1279],{"style":83},[69,2637,2607],{"style":83},[59,2639,2641],{"language":1234,"filename":1332,"code":2640,"class":64},"bun add -d @kubb\u002Fplugin-zod",[28,2642,2643],{"class":1239},[69,2644,2645,2647,2649,2651],{"class":71,"style":72},[69,2646,1340],{"style":108},[69,2648,1681],{"style":83},[69,2650,1279],{"style":83},[69,2652,2607],{"style":83},[10,2654,2655,2656,2658,2659,2661],{},"orval writes one schema per operation and inlines the model in each. Kubb writes one schema per model, such as ",[28,2657,1008],{},", and the operation schemas refer to it. Run ",[28,2660,1361],{},", then replace each import:",[56,2663,2664,2735],{},[59,2665,2667],{"language":61,"filename":17,"code":2666,"class":64},"import { GetPetByIdParams, GetPetByIdResponse } from '.\u002Fapi\u002Fpet\u002Fpet.zod'\n\nconst pet = GetPetByIdResponse.parse(json)\nconst path = GetPetByIdParams.parse(params)",[28,2668,2669,95,2690,95,2692,95,2713],{"class":67},[69,2670,2671,2673,2675,2678,2680,2683,2685,2687],{"class":71,"style":72},[69,2672,76],{"style":75},[69,2674,80],{"style":79},[69,2676,2677],{"style":108},"GetPetByIdParams",[69,2679,31],{"style":75},[69,2681,2682],{"style":108},"GetPetByIdResponse ",[69,2684,87],{"style":79},[69,2686,90],{"style":75},[69,2688,2689],{"style":93},"'.\u002Fapi\u002Fpet\u002Fpet.zod'",[69,2691],{"class":71,"style":72},[69,2693,2694,2696,2698,2700,2702,2704,2707,2709,2711],{"class":71,"style":72},[69,2695,1514],{"style":75},[69,2697,2376],{"style":83},[69,2699,1524],{"style":75},[69,2701,1002],{"style":108},[69,2703,46],{"style":75},[69,2705,2706],{"style":108},"parse",[69,2708,1861],{"style":79},[69,2710,1374],{"style":83},[69,2712,2369],{"style":79},[69,2714,2715,2717,2720,2722,2724,2726,2728,2730,2733],{"class":71,"style":72},[69,2716,1514],{"style":75},[69,2718,2719],{"style":83},"path ",[69,2721,1524],{"style":75},[69,2723,2677],{"style":108},[69,2725,46],{"style":75},[69,2727,2706],{"style":108},[69,2729,1861],{"style":79},[69,2731,2732],{"style":83},"params",[69,2734,2369],{"style":79},[59,2736,2738],{"language":61,"filename":763,"code":2737,"class":64},"import { getPetByIdPathSchema } from '.\u002Fgen\u002Fzod\u002FgetPetByIdSchema'\nimport { petSchema } from '.\u002Fgen\u002Fzod\u002FpetSchema'\n\nconst pet = petSchema.parse(json)\nconst path = getPetByIdPathSchema.parse(params)",[28,2739,2740,95,2756,95,2772,95,2774,95,2794],{"class":67},[69,2741,2742,2744,2746,2749,2751,2753],{"class":71,"style":72},[69,2743,76],{"style":75},[69,2745,80],{"style":79},[69,2747,2748],{"style":83},"getPetByIdPathSchema ",[69,2750,87],{"style":79},[69,2752,90],{"style":75},[69,2754,2755],{"style":93},"'.\u002Fgen\u002Fzod\u002FgetPetByIdSchema'",[69,2757,2758,2760,2762,2765,2767,2769],{"class":71,"style":72},[69,2759,76],{"style":75},[69,2761,80],{"style":79},[69,2763,2764],{"style":83},"petSchema ",[69,2766,87],{"style":79},[69,2768,90],{"style":75},[69,2770,2771],{"style":93},"'.\u002Fgen\u002Fzod\u002FpetSchema'",[69,2773],{"class":71,"style":72},[69,2775,2776,2778,2780,2782,2784,2786,2788,2790,2792],{"class":71,"style":72},[69,2777,1514],{"style":75},[69,2779,2376],{"style":83},[69,2781,1524],{"style":75},[69,2783,1008],{"style":83},[69,2785,46],{"style":75},[69,2787,2706],{"style":108},[69,2789,1861],{"style":79},[69,2791,1374],{"style":83},[69,2793,2369],{"style":79},[69,2795,2796,2798,2800,2802,2805,2807,2809,2811,2813],{"class":71,"style":72},[69,2797,1514],{"style":75},[69,2799,2719],{"style":83},[69,2801,1524],{"style":75},[69,2803,2804],{"style":83},"getPetByIdPathSchema",[69,2806,46],{"style":75},[69,2808,2706],{"style":108},[69,2810,1861],{"style":79},[69,2812,2732],{"style":83},[69,2814,2369],{"style":79},[48,2816,2818],{"id":2817},"replace-the-mocks","Replace the mocks",[10,2820,1603,2821,862,2826,2831,2832,2835],{},[14,2822,2823],{"href":908},[28,2824,2825],{},"@kubb\u002Fplugin-faker",[14,2827,2828],{"href":903},[28,2829,2830],{},"@kubb\u002Fplugin-msw",". The generated code needs MSW 3 and ",[28,2833,2834],{},"@faker-js\u002Ffaker"," 10, so upgrade them first if the app is on older versions:",[56,2837,2838,2857,2878,2897,2916],{"sync":1231},[59,2839,2841],{"language":1234,"filename":1235,"code":2840,"class":64},"kubb add plugin-faker\nkubb add plugin-msw",[28,2842,2843,95,2850],{"class":1239},[69,2844,2845,2847],{"class":71,"style":72},[69,2846,1252],{"style":108},[69,2848,2849],{"style":83},"add plugin-faker",[69,2851,2852,2854],{"class":71,"style":72},[69,2853,1252],{"style":108},[69,2855,2856],{"style":83},"add plugin-msw",[59,2858,2860],{"language":1234,"filename":1265,"code":2859,"class":64},"pnpm add -D @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[28,2861,2862],{"class":1239},[69,2863,2864,2866,2868,2870,2873,2875],{"class":71,"style":72},[69,2865,1273],{"style":108},[69,2867,1633],{"style":83},[69,2869,1279],{"style":83},[69,2871,2872],{"style":83},"kubb\u002Fplugin-faker ",[69,2874,1279],{"style":83},[69,2876,2877],{"style":83},"kubb\u002Fplugin-msw",[59,2879,2881],{"language":1234,"filename":1290,"code":2880,"class":64},"npm install -D @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[28,2882,2883],{"class":1239},[69,2884,2885,2887,2889,2891,2893,2895],{"class":71,"style":72},[69,2886,1244],{"style":108},[69,2888,1650],{"style":83},[69,2890,1279],{"style":83},[69,2892,2872],{"style":83},[69,2894,1279],{"style":83},[69,2896,2877],{"style":83},[59,2898,2900],{"language":1234,"filename":1311,"code":2899,"class":64},"yarn add -D @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[28,2901,2902],{"class":1239},[69,2903,2904,2906,2908,2910,2912,2914],{"class":71,"style":72},[69,2905,1319],{"style":108},[69,2907,1633],{"style":83},[69,2909,1279],{"style":83},[69,2911,2872],{"style":83},[69,2913,1279],{"style":83},[69,2915,2877],{"style":83},[59,2917,2919],{"language":1234,"filename":1332,"code":2918,"class":64},"bun add -d @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[28,2920,2921],{"class":1239},[69,2922,2923,2925,2927,2929,2931,2933],{"class":71,"style":72},[69,2924,1340],{"style":108},[69,2926,1681],{"style":83},[69,2928,1279],{"style":83},[69,2930,2872],{"style":83},[69,2932,1279],{"style":83},[69,2934,2877],{"style":83},[10,2936,2937,2938,1058,2940,2943,2944,2947],{},"Set the options on ",[28,2939,695],{},[28,2941,2942],{},"parser: 'faker'"," makes a handler return generated data, like orval's mocks, and ",[28,2945,2946],{},"handlers: true"," exports every handler as one list:",[59,2949,2951],{"language":61,"filename":363,"code":2950,"class":64},"import { pluginFaker } from '@kubb\u002Fplugin-faker'\nimport { pluginMsw } from '@kubb\u002Fplugin-msw'\n\n\u002F\u002F ...\nplugins: [\n \u002F\u002F ...\n pluginFaker(),\n pluginMsw({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', parser: 'faker', handlers: true }),\n],",[28,2952,2953,95,2967,95,2981,95,2983,95,2987,95,2995,95,3001,95,3011,95,3045],{"class":67},[69,2954,2955,2957,2959,2961,2963,2965],{"class":71,"style":72},[69,2956,76],{"style":75},[69,2958,80],{"style":79},[69,2960,406],{"style":83},[69,2962,87],{"style":79},[69,2964,90],{"style":75},[69,2966,413],{"style":93},[69,2968,2969,2971,2973,2975,2977,2979],{"class":71,"style":72},[69,2970,76],{"style":75},[69,2972,80],{"style":79},[69,2974,438],{"style":83},[69,2976,87],{"style":79},[69,2978,90],{"style":75},[69,2980,445],{"style":93},[69,2982],{"class":71,"style":72},[69,2984,2985],{"class":71,"style":72},[69,2986,1726],{"style":612},[69,2988,2989,2991,2993],{"class":71,"style":72},[69,2990,573],{"style":83},[69,2992,123],{"style":75},[69,2994,578],{"style":79},[69,2996,2997,2999],{"class":71,"style":72},[69,2998,117],{"style":79},[69,3000,1726],{"style":612},[69,3002,3003,3005,3007,3009],{"class":71,"style":72},[69,3004,117],{"style":612},[69,3006,684],{"style":108},[69,3008,675],{"style":79},[69,3010,142],{"style":75},[69,3012,3013,3015,3017,3019,3021,3023,3025,3027,3029,3031,3033,3035,3037,3039,3041,3043],{"class":71,"style":72},[69,3014,117],{"style":75},[69,3016,695],{"style":108},[69,3018,554],{"style":79},[69,3020,625],{"style":79},[69,3022,123],{"style":75},[69,3024,630],{"style":93},[69,3026,31],{"style":75},[69,3028,708],{"style":79},[69,3030,123],{"style":75},[69,3032,713],{"style":93},[69,3034,31],{"style":75},[69,3036,718],{"style":79},[69,3038,123],{"style":75},[69,3040,661],{"style":79},[69,3042,360],{"style":79},[69,3044,142],{"style":75},[69,3046,3047,3049],{"class":71,"style":72},[69,3048,733],{"style":79},[69,3050,142],{"style":75},[10,3052,2281,3053,3055],{},[28,3054,1361],{},", then replace the handlers and the mock data:",[56,3057,3058,3188],{},[59,3059,3061],{"language":61,"filename":17,"code":3060,"class":64},"import { setupServer } from 'msw\u002Fnode'\nimport { getGetPetByIdResponseMock } from '.\u002Fapi\u002Fpet\u002Fpet.faker'\nimport { getGetPetByIdMockHandler, getPetMock } from '.\u002Fapi\u002Fpet\u002Fpet.msw'\n\nexport const server = setupServer(getGetPetByIdMockHandler({ name: 'Rex', photoUrls: [] }), ...getPetMock())\n\nconst pet = getGetPetByIdResponseMock({ name: 'Rex' })",[28,3062,3063,95,3079,95,3095,95,3116,95,3118,95,3164,95,3166],{"class":67},[69,3064,3065,3067,3069,3072,3074,3076],{"class":71,"style":72},[69,3066,76],{"style":75},[69,3068,80],{"style":79},[69,3070,3071],{"style":83},"setupServer ",[69,3073,87],{"style":79},[69,3075,90],{"style":75},[69,3077,3078],{"style":93},"'msw\u002Fnode'",[69,3080,3081,3083,3085,3088,3090,3092],{"class":71,"style":72},[69,3082,76],{"style":75},[69,3084,80],{"style":79},[69,3086,3087],{"style":83},"getGetPetByIdResponseMock ",[69,3089,87],{"style":79},[69,3091,90],{"style":75},[69,3093,3094],{"style":93},"'.\u002Fapi\u002Fpet\u002Fpet.faker'",[69,3096,3097,3099,3101,3104,3106,3109,3111,3113],{"class":71,"style":72},[69,3098,76],{"style":75},[69,3100,80],{"style":79},[69,3102,3103],{"style":83},"getGetPetByIdMockHandler",[69,3105,31],{"style":75},[69,3107,3108],{"style":83},"getPetMock ",[69,3110,87],{"style":79},[69,3112,90],{"style":75},[69,3114,3115],{"style":93},"'.\u002Fapi\u002Fpet\u002Fpet.msw'",[69,3117],{"class":71,"style":72},[69,3119,3120,3122,3124,3127,3129,3132,3134,3136,3138,3140,3142,3144,3146,3148,3150,3153,3155,3158,3161],{"class":71,"style":72},[69,3121,102],{"style":75},[69,3123,1514],{"style":75},[69,3125,3126],{"style":83},"server ",[69,3128,1524],{"style":75},[69,3130,3131],{"style":108},"setupServer",[69,3133,1861],{"style":79},[69,3135,3103],{"style":108},[69,3137,554],{"style":79},[69,3139,2420],{"style":79},[69,3141,123],{"style":75},[69,3143,2425],{"style":93},[69,3145,31],{"style":75},[69,3147,2430],{"style":79},[69,3149,123],{"style":75},[69,3151,3152],{"style":79},"[] })",[69,3154,31],{"style":75},[69,3156,3157],{"style":75},"...",[69,3159,3160],{"style":108},"getPetMock",[69,3162,3163],{"style":79},"())",[69,3165],{"class":71,"style":72},[69,3167,3168,3170,3172,3174,3177,3179,3181,3183,3186],{"class":71,"style":72},[69,3169,1514],{"style":75},[69,3171,2376],{"style":83},[69,3173,1524],{"style":75},[69,3175,3176],{"style":108},"getGetPetByIdResponseMock",[69,3178,554],{"style":79},[69,3180,2420],{"style":79},[69,3182,123],{"style":75},[69,3184,3185],{"style":93},"'Rex' ",[69,3187,360],{"style":79},[59,3189,3191],{"language":61,"filename":763,"code":3190,"class":64},"import { setupServer } from 'msw\u002Fnode'\nimport { getPetByIdHandler } from '.\u002Fgen\u002Fhandlers\u002FgetPetByIdHandler'\nimport { handlers } from '.\u002Fgen\u002Fhandlers\u002Fhandlers'\nimport { createPet } from '.\u002Fgen\u002Fmocks\u002FcreatePet'\n\nexport const server = setupServer(getPetByIdHandler({ name: 'Rex', photoUrls: [] }), ...handlers)\n\nconst pet = createPet({ name: 'Rex' })",[28,3192,3193,95,3207,95,3223,95,3239,95,3255,95,3257,95,3298,95,3300],{"class":67},[69,3194,3195,3197,3199,3201,3203,3205],{"class":71,"style":72},[69,3196,76],{"style":75},[69,3198,80],{"style":79},[69,3200,3071],{"style":83},[69,3202,87],{"style":79},[69,3204,90],{"style":75},[69,3206,3078],{"style":93},[69,3208,3209,3211,3213,3216,3218,3220],{"class":71,"style":72},[69,3210,76],{"style":75},[69,3212,80],{"style":79},[69,3214,3215],{"style":83},"getPetByIdHandler ",[69,3217,87],{"style":79},[69,3219,90],{"style":75},[69,3221,3222],{"style":93},"'.\u002Fgen\u002Fhandlers\u002FgetPetByIdHandler'",[69,3224,3225,3227,3229,3232,3234,3236],{"class":71,"style":72},[69,3226,76],{"style":75},[69,3228,80],{"style":79},[69,3230,3231],{"style":83},"handlers ",[69,3233,87],{"style":79},[69,3235,90],{"style":75},[69,3237,3238],{"style":93},"'.\u002Fgen\u002Fhandlers\u002Fhandlers'",[69,3240,3241,3243,3245,3248,3250,3252],{"class":71,"style":72},[69,3242,76],{"style":75},[69,3244,80],{"style":79},[69,3246,3247],{"style":83},"createPet ",[69,3249,87],{"style":79},[69,3251,90],{"style":75},[69,3253,3254],{"style":93},"'.\u002Fgen\u002Fmocks\u002FcreatePet'",[69,3256],{"class":71,"style":72},[69,3258,3259,3261,3263,3265,3267,3269,3271,3274,3276,3278,3280,3282,3284,3286,3288,3290,3292,3294,3296],{"class":71,"style":72},[69,3260,102],{"style":75},[69,3262,1514],{"style":75},[69,3264,3126],{"style":83},[69,3266,1524],{"style":75},[69,3268,3131],{"style":108},[69,3270,1861],{"style":79},[69,3272,3273],{"style":108},"getPetByIdHandler",[69,3275,554],{"style":79},[69,3277,2420],{"style":79},[69,3279,123],{"style":75},[69,3281,2425],{"style":93},[69,3283,31],{"style":75},[69,3285,2430],{"style":79},[69,3287,123],{"style":75},[69,3289,3152],{"style":79},[69,3291,31],{"style":75},[69,3293,3157],{"style":75},[69,3295,718],{"style":83},[69,3297,2369],{"style":79},[69,3299],{"class":71,"style":72},[69,3301,3302,3304,3306,3308,3311,3313,3315,3317,3319],{"class":71,"style":72},[69,3303,1514],{"style":75},[69,3305,2376],{"style":83},[69,3307,1524],{"style":75},[69,3309,3310],{"style":108},"createPet",[69,3312,554],{"style":79},[69,3314,2420],{"style":79},[69,3316,123],{"style":75},[69,3318,3185],{"style":93},[69,3320,360],{"style":79},[10,3322,3323,3325,3326,3330],{},[28,3324,718],{}," holds every operation, where orval has one list per tag. ",[14,3327,3329],{"href":3328},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-msw\u002Fguides\u002Fmock-api","Mock API responses"," has more.",[48,3332,3334],{"id":3333},"remove-orval","Remove orval",[10,3336,3337,3338,3340,3341,862,3343,3345,3346,46],{},"Once nothing imports from ",[28,3339,45],{},", delete ",[28,3342,45],{},[28,3344,62],{},", and uninstall ",[28,3347,17],{},{"title":3349,"searchDepth":3350,"depth":3350,"links":3351},"",5,[3352,3354,3359,3360,3361,3362,3363,3364],{"id":50,"depth":3353,"text":51},2,{"id":742,"depth":3353,"text":743,"children":3355},[3356,3358],{"id":747,"depth":3357,"text":748},3,{"id":913,"depth":3357,"text":914},{"id":1050,"depth":3353,"text":1051},{"id":1599,"depth":3353,"text":1600},{"id":2144,"depth":3353,"text":2145},{"id":2555,"depth":3353,"text":2556},{"id":2817,"depth":3353,"text":2818},{"id":3333,"depth":3353,"text":3334},"Replace orval with Kubb. Generate the same types, then swap the client, query hooks, Zod schemas, and MSW mocks one step at a time.","md",{"layout":3368,"title":5,"description":3365,"outline":3369,"order":3370,"navigation":3371},"doc",[3353,3357],1,{"title":3372,"icon":3373},"Move from orval","i-iconoir-git-fork",{"layout":3368,"outline":3375},[3353,3357],{"title":3372,"icon":3373},"\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval",{"title":5,"description":3365},{"loc":3377},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval.md","docs\u002F5.x\u002Fmigrate\u002Ffrom-orval","Tzc8kOag2AJjzAYDtxzN1Rvh0E5IpXAKcfBF1CAsLsU",1795727674782,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]