[{"data":1,"prerenderedAt":3089},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize":3},{"id":4,"title":5,"body":6,"description":3073,"extension":3074,"frontmatter":3075,"heading":5,"meta":3080,"navigation":3082,"order":3063,"path":3083,"seo":3084,"sitemap":3085,"source":3086,"stem":3087,"__hash__":3088},"docs\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize.md","Customize generated code",{"type":7,"value":8,"toc":3055},"minimark",[9,13,98,101,105,114,119,125,221,235,908,931,934,945,1010,1019,1418,1423,1440,1673,1686,1689,1692,1696,1707,1716,2297,2301,2310,2495,2499,2512,2585,2592,2975,2979,2988,2995,2998,3022,3026,3029,3041],[10,11,12],"p",{},"You change what a plugin generates with one of these options, without forking it:",[14,15,16,32],"table",{},[17,18,19],"thead",{},[20,21,22,26,29],"tr",{},[23,24,25],"th",{},"You want to change",[23,27,28],{},"Use",[23,30,31],{},"Applies to",[33,34,35,54,70],"tbody",{},[20,36,37,41,51],{},[38,39,40],"td",{},"What a type, function, or file is called, or where a file lands",[38,42,43],{},[44,45,47],"a",{"href":46},"#resolvers",[48,49,50],"code",{},"resolver",[38,52,53],{},"The plugin you set it on",[20,55,56,59,67],{},[38,57,58],{},"The schema itself, such as a field type, a name, or metadata",[38,60,61],{},[44,62,64],{"href":63},"#macros",[48,65,66],{},"macros",[38,68,69],{},"Every plugin you pass the macro to",[20,71,72,78,86],{},[38,73,74,75],{},"The code printed for one schema type, such as ",[48,76,77],{},"date",[38,79,80],{},[44,81,83],{"href":82},"#printers",[48,84,85],{},"printer.nodes",[38,87,88,91,92,91,95],{},[48,89,90],{},"@kubb\u002Fplugin-ts",", ",[48,93,94],{},"@kubb\u002Fplugin-zod",[48,96,97],{},"@kubb\u002Fplugin-faker",[10,99,100],{},"Macros run before the resolver, so when a macro changes a name, the generated names, paths, and files follow:",[102,103],"mermaid",{"svg":104},"\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" class=\"pele pele-flowchart\" viewBox=\"0 0 773 170\" width=\"773\" height=\"170\" style=\"--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,monospace);font:16px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,sans-serif)\" fill=\"var(--_fg)\" role=\"graphics-document document\" aria-roledescription=\"flowchart\">\u003Cg class=\"pele-edges\" fill=\"none\" stroke=\"var(--_l)\" stroke-linecap=\"round\">\u003Cg class=\"pele-edge\" data-id=\"L_A_M_0\">\u003Cpath d=\"M75.12,80.5L116.12,80.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M123.12,80.5L115.12,83.86L115.12,77.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_M_G_0\">\u003Cpath d=\"M211.57,80.5L252.57,80.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M259.57,80.5L251.57,83.86L251.57,77.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_G_R_0\">\u003Cpath d=\"M367.6,72.5C385.1,72.5 385.1,32 402.6,32L408.6,32\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M415.6,32L407.6,35.36L407.6,28.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_G_P_0\">\u003Cpath d=\"M367.6,88.5C389.1,88.5 389.1,129 410.61,129L416.61,129\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M423.61,129L415.61,132.36L415.61,125.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_R_F_0\">\u003Cpath d=\"M646.35,32C663.85,32 663.85,72.5 681.35,72.5L687.35,72.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M694.35,72.5L686.35,75.86L686.35,69.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_P_F_0\">\u003Cpath d=\"M638.34,129C659.85,129 659.85,88.5 681.35,88.5L687.35,88.5\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M694.35,88.5L686.35,91.86L686.35,85.14Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg class=\"pele-nodes\">\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"A\" transform=\"translate(41.56,80.5)\">\u003Crect x=\"-33.56\" y=\"-24\" width=\"67.12\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">AST\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"M\" transform=\"translate(167.34,80.5)\">\u003Crect x=\"-44.22\" y=\"-24\" width=\"88.45\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Macros\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"G\" transform=\"translate(313.58,80.5)\">\u003Crect x=\"-54.02\" y=\"-24\" width=\"108.03\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Generator\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"R\" transform=\"translate(530.98,32)\">\u003Crect x=\"-115.38\" y=\"-24\" width=\"230.75\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Resolver: names and paths\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"P\" transform=\"translate(530.98,129)\">\u003Crect x=\"-107.37\" y=\"-33\" width=\"214.74\" height=\"66\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" text-anchor=\"middle\" xml:space=\"preserve\">\u003Ctspan x=\"0\" y=\"-4.9\">Printer: code per schema\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"16.1\">type\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"F\" transform=\"translate(729.24,80.5)\">\u003Crect x=\"-34.89\" y=\"-24\" width=\"69.78\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Files\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fsvg>",[106,107,109,110,113],"blockquote",{"as":108},"tip","When an override uses ",[48,111,112],{},"this",", write it as a regular method, not an arrow function.",[115,116,118],"h2",{"id":117},"resolvers","Resolvers",[10,120,121,122,124],{},"A resolver names every symbol and file a plugin writes. Pass only the methods you replace to the plugin's ",[48,123,50],{}," option. The rest keep their defaults.",[14,126,127,140],{},[17,128,129],{},[20,130,131,134,137],{},[23,132,133],{},"Method",[23,135,136],{},"Builds",[23,138,139],{},"Plugin",[33,141,142,155,167,179,200],{},[20,143,144,149,152],{},[38,145,146],{},[48,147,148],{},"name(name)",[38,150,151],{},"Every identifier",[38,153,154],{},"All",[20,156,157,162,165],{},[38,158,159],{},[48,160,161],{},"file.baseName({ name, extname })",[38,163,164],{},"A file name, extension included",[38,166,154],{},[20,168,169,174,177],{},[38,170,171],{},[48,172,173],{},"file.path({ baseName, output })",[38,175,176],{},"The full file path",[38,178,154],{},[20,180,181,186,192],{},[38,182,183],{},[48,184,185],{},"query.keyName(node)",[38,187,188,189],{},"A query key, such as ",[48,190,191],{},"getPetByIdQueryKey",[38,193,194,91,197],{},[48,195,196],{},"@kubb\u002Fplugin-react-query",[48,198,199],{},"@kubb\u002Fplugin-vue-query",[20,201,202,207,213],{},[38,203,204],{},[48,205,206],{},"response.status(node, statusCode)",[38,208,209,210],{},"A response name, such as ",[48,211,212],{},"GetPetByIdStatus200",[38,214,215,91,217,91,219],{},[48,216,90],{},[48,218,94],{},[48,220,97],{},[10,222,223,224,228,229,234],{},"Each plugin's options page lists its own namespaces. ",[44,225,227],{"href":226},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fresolvers#resolver-overrides","Resolver overrides"," has the signatures. ",[44,230,232],{"href":231},"\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#resolver",[48,233,50],{}," lists the shared members.",[236,237,238,385,519,633,766],"code-group",{},[239,240,245],"pre",{"language":241,"filename":242,"code":243,"class":244},"typescript","Prefix names","import { pluginTs, resolverTs } from '@kubb\u002Fplugin-ts'\n\npluginTs({\n  resolver: {\n    \u002F\u002F Calls the preset to keep PascalCase: Pet becomes ApiPet\n    name(name) {\n      return `Api${resolverTs.name(name)}`\n    },\n  },\n})","highlights",[48,246,248,280,281,280,283,280,291,280,304,280,313,280,328,280,363,280,372,280,380],{"class":247},"language-typescript",[249,250,253,257,261,265,267,270,273,276],"span",{"class":251,"style":252},"line","display: inline",[249,254,256],{"style":255},"color:#d73a49;--hls-dark:#f97583","import ",[249,258,260],{"style":259},"color:#005cc5;--hls-dark:#79b8ff","{ ",[249,262,264],{"style":263},"color:#24292e;--hls-dark:#e1e4e8","pluginTs",[249,266,91],{"style":255},[249,268,269],{"style":263},"resolverTs ",[249,271,272],{"style":259},"} ",[249,274,275],{"style":255},"from ",[249,277,279],{"style":278},"color:#032f62;--hls-dark:#9ecbff","'@kubb\u002Fplugin-ts'","\n",[249,282],{"class":251,"style":252},[249,284,285,288],{"class":251,"style":252},[249,286,264],{"style":287},"color:#6f42c1;--hls-dark:#b392f0",[249,289,290],{"style":259},"({",[249,292,293,296,298,301],{"class":251,"style":252},[249,294,295],{"style":259},"  ",[249,297,50],{"style":259},[249,299,300],{"style":255},": ",[249,302,303],{"style":259},"{",[249,305,306,309],{"class":251,"style":252},[249,307,308],{"style":259},"    ",[249,310,312],{"style":311},"color:#6a737d;--hls-dark:#6a737d","\u002F\u002F Calls the preset to keep PascalCase: Pet becomes ApiPet",[249,314,315,317,320,323,325],{"class":251,"style":252},[249,316,308],{"style":311},[249,318,319],{"style":287},"name",[249,321,322],{"style":259},"(",[249,324,319],{"style":263},[249,326,327],{"style":259},") {",[249,329,330,333,336,339,342,345,348,350,352,354,357,360],{"class":251,"style":252},[249,331,332],{"style":259},"      ",[249,334,335],{"style":255},"return ",[249,337,338],{"style":278},"`Api",[249,340,341],{"style":263},"${",[249,343,344],{"style":263},"resolverTs",[249,346,347],{"style":255},".",[249,349,319],{"style":287},[249,351,322],{"style":259},[249,353,319],{"style":263},[249,355,356],{"style":259},")",[249,358,359],{"style":263},"}",[249,361,362],{"style":278},"`",[249,364,365,367,369],{"class":251,"style":252},[249,366,308],{"style":278},[249,368,359],{"style":259},[249,370,371],{"style":255},",",[249,373,374,376,378],{"class":251,"style":252},[249,375,295],{"style":255},[249,377,359],{"style":259},[249,379,371],{"style":255},[249,381,382],{"class":251,"style":252},[249,383,384],{"style":259},"})",[239,386,389],{"language":241,"filename":387,"code":388,"class":244},"Rename files","import { pluginFaker } from '@kubb\u002Fplugin-faker'\n\npluginFaker({\n  resolver: {\n    file: {\n      \u002F\u002F Pet.mock.ts instead of the default createPet.ts\n      baseName({ name, extname }) {\n        return `${name}.mock${extname}`\n      },\n    },\n  },\n})",[48,390,391,280,407,280,409,280,416,280,426,280,437,280,444,280,464,280,491,280,499,280,507,280,515],{"class":247},[249,392,393,395,397,400,402,404],{"class":251,"style":252},[249,394,256],{"style":255},[249,396,260],{"style":259},[249,398,399],{"style":263},"pluginFaker ",[249,401,272],{"style":259},[249,403,275],{"style":255},[249,405,406],{"style":278},"'@kubb\u002Fplugin-faker'",[249,408],{"class":251,"style":252},[249,410,411,414],{"class":251,"style":252},[249,412,413],{"style":287},"pluginFaker",[249,415,290],{"style":259},[249,417,418,420,422,424],{"class":251,"style":252},[249,419,295],{"style":259},[249,421,50],{"style":259},[249,423,300],{"style":255},[249,425,303],{"style":259},[249,427,428,430,433,435],{"class":251,"style":252},[249,429,308],{"style":259},[249,431,432],{"style":259},"file",[249,434,300],{"style":255},[249,436,303],{"style":259},[249,438,439,441],{"class":251,"style":252},[249,440,332],{"style":259},[249,442,443],{"style":311},"\u002F\u002F Pet.mock.ts instead of the default createPet.ts",[249,445,446,448,451,454,456,458,461],{"class":251,"style":252},[249,447,332],{"style":311},[249,449,450],{"style":287},"baseName",[249,452,453],{"style":259},"({ ",[249,455,319],{"style":263},[249,457,91],{"style":255},[249,459,460],{"style":263},"extname ",[249,462,463],{"style":259},"}) {",[249,465,466,469,471,473,475,477,479,482,484,487,489],{"class":251,"style":252},[249,467,468],{"style":259},"        ",[249,470,335],{"style":255},[249,472,362],{"style":278},[249,474,341],{"style":263},[249,476,319],{"style":263},[249,478,359],{"style":263},[249,480,481],{"style":278},".mock",[249,483,341],{"style":263},[249,485,486],{"style":263},"extname",[249,488,359],{"style":263},[249,490,362],{"style":278},[249,492,493,495,497],{"class":251,"style":252},[249,494,332],{"style":278},[249,496,359],{"style":259},[249,498,371],{"style":255},[249,500,501,503,505],{"class":251,"style":252},[249,502,308],{"style":255},[249,504,359],{"style":259},[249,506,371],{"style":255},[249,508,509,511,513],{"class":251,"style":252},[249,510,295],{"style":255},[249,512,359],{"style":259},[249,514,371],{"style":255},[249,516,517],{"class":251,"style":252},[249,518,384],{"style":259},[239,520,523],{"language":241,"filename":521,"code":522,"class":244},"Move files","import { pluginFaker } from '@kubb\u002Fplugin-faker'\n\npluginFaker({\n  resolver: {\n    file: {\n      \u002F\u002F src\u002Fgen\u002Ffixtures\u002F instead of src\u002Fgen\u002Fmocks\u002F\n      path({ baseName }) {\n        return `fixtures\u002F${baseName}`\n      },\n    },\n  },\n})",[48,524,525,280,539,280,541,280,547,280,557,280,567,280,574,280,588,280,605,280,613,280,621,280,629],{"class":247},[249,526,527,529,531,533,535,537],{"class":251,"style":252},[249,528,256],{"style":255},[249,530,260],{"style":259},[249,532,399],{"style":263},[249,534,272],{"style":259},[249,536,275],{"style":255},[249,538,406],{"style":278},[249,540],{"class":251,"style":252},[249,542,543,545],{"class":251,"style":252},[249,544,413],{"style":287},[249,546,290],{"style":259},[249,548,549,551,553,555],{"class":251,"style":252},[249,550,295],{"style":259},[249,552,50],{"style":259},[249,554,300],{"style":255},[249,556,303],{"style":259},[249,558,559,561,563,565],{"class":251,"style":252},[249,560,308],{"style":259},[249,562,432],{"style":259},[249,564,300],{"style":255},[249,566,303],{"style":259},[249,568,569,571],{"class":251,"style":252},[249,570,332],{"style":259},[249,572,573],{"style":311},"\u002F\u002F src\u002Fgen\u002Ffixtures\u002F instead of src\u002Fgen\u002Fmocks\u002F",[249,575,576,578,581,583,586],{"class":251,"style":252},[249,577,332],{"style":311},[249,579,580],{"style":287},"path",[249,582,453],{"style":259},[249,584,585],{"style":263},"baseName ",[249,587,463],{"style":259},[249,589,590,592,594,597,599,601,603],{"class":251,"style":252},[249,591,468],{"style":259},[249,593,335],{"style":255},[249,595,596],{"style":278},"`fixtures\u002F",[249,598,341],{"style":263},[249,600,450],{"style":263},[249,602,359],{"style":263},[249,604,362],{"style":278},[249,606,607,609,611],{"class":251,"style":252},[249,608,332],{"style":278},[249,610,359],{"style":259},[249,612,371],{"style":255},[249,614,615,617,619],{"class":251,"style":252},[249,616,308],{"style":255},[249,618,359],{"style":259},[249,620,371],{"style":255},[249,622,623,625,627],{"class":251,"style":252},[249,624,295],{"style":255},[249,626,359],{"style":259},[249,628,371],{"style":255},[249,630,631],{"class":251,"style":252},[249,632,384],{"style":259},[239,634,637],{"language":241,"filename":635,"code":636,"class":244},"Query keys","import { pluginReactQuery } from '@kubb\u002Fplugin-react-query'\n\npluginReactQuery({\n  resolver: {\n    query: {\n      \u002F\u002F this.name keeps the active naming rule: getPetByIdKey\n      keyName(node) {\n        return `${this.name(node.operationId)}Key`\n      },\n    },\n  },\n})",[48,638,639,280,655,280,657,280,664,280,674,280,685,280,692,280,706,280,738,280,746,280,754,280,762],{"class":247},[249,640,641,643,645,648,650,652],{"class":251,"style":252},[249,642,256],{"style":255},[249,644,260],{"style":259},[249,646,647],{"style":263},"pluginReactQuery ",[249,649,272],{"style":259},[249,651,275],{"style":255},[249,653,654],{"style":278},"'@kubb\u002Fplugin-react-query'",[249,656],{"class":251,"style":252},[249,658,659,662],{"class":251,"style":252},[249,660,661],{"style":287},"pluginReactQuery",[249,663,290],{"style":259},[249,665,666,668,670,672],{"class":251,"style":252},[249,667,295],{"style":259},[249,669,50],{"style":259},[249,671,300],{"style":255},[249,673,303],{"style":259},[249,675,676,678,681,683],{"class":251,"style":252},[249,677,308],{"style":259},[249,679,680],{"style":259},"query",[249,682,300],{"style":255},[249,684,303],{"style":259},[249,686,687,689],{"class":251,"style":252},[249,688,332],{"style":259},[249,690,691],{"style":311},"\u002F\u002F this.name keeps the active naming rule: getPetByIdKey",[249,693,694,696,699,701,704],{"class":251,"style":252},[249,695,332],{"style":311},[249,697,698],{"style":287},"keyName",[249,700,322],{"style":259},[249,702,703],{"style":263},"node",[249,705,327],{"style":259},[249,707,708,710,712,714,716,718,720,722,724,726,728,731,733,735],{"class":251,"style":252},[249,709,468],{"style":259},[249,711,335],{"style":255},[249,713,362],{"style":278},[249,715,341],{"style":263},[249,717,112],{"style":263},[249,719,347],{"style":255},[249,721,319],{"style":287},[249,723,322],{"style":259},[249,725,703],{"style":263},[249,727,347],{"style":255},[249,729,730],{"style":259},"operationId",[249,732,356],{"style":259},[249,734,359],{"style":263},[249,736,737],{"style":278},"Key`",[249,739,740,742,744],{"class":251,"style":252},[249,741,332],{"style":278},[249,743,359],{"style":259},[249,745,371],{"style":255},[249,747,748,750,752],{"class":251,"style":252},[249,749,308],{"style":255},[249,751,359],{"style":259},[249,753,371],{"style":255},[249,755,756,758,760],{"class":251,"style":252},[249,757,295],{"style":255},[249,759,359],{"style":259},[249,761,371],{"style":255},[249,763,764],{"class":251,"style":252},[249,765,384],{"style":259},[239,767,770],{"language":241,"filename":768,"code":769,"class":244},"Response types","import { pluginTs } from '@kubb\u002Fplugin-ts'\n\npluginTs({\n  resolver: {\n    response: {\n      \u002F\u002F GetPetById200Response instead of GetPetByIdStatus200\n      status(node, statusCode) {\n        return this.name(`${node.operationId} ${statusCode} response`)\n      },\n    },\n  },\n})",[48,771,772,280,787,280,789,280,795,280,805,280,816,280,823,280,841,280,881,280,888,280,896,280,904],{"class":247},[249,773,774,776,778,781,783,785],{"class":251,"style":252},[249,775,256],{"style":255},[249,777,260],{"style":259},[249,779,780],{"style":263},"pluginTs ",[249,782,272],{"style":259},[249,784,275],{"style":255},[249,786,279],{"style":278},[249,788],{"class":251,"style":252},[249,790,791,793],{"class":251,"style":252},[249,792,264],{"style":287},[249,794,290],{"style":259},[249,796,797,799,801,803],{"class":251,"style":252},[249,798,295],{"style":259},[249,800,50],{"style":259},[249,802,300],{"style":255},[249,804,303],{"style":259},[249,806,807,809,812,814],{"class":251,"style":252},[249,808,308],{"style":259},[249,810,811],{"style":259},"response",[249,813,300],{"style":255},[249,815,303],{"style":259},[249,817,818,820],{"class":251,"style":252},[249,819,332],{"style":259},[249,821,822],{"style":311},"\u002F\u002F GetPetById200Response instead of GetPetByIdStatus200",[249,824,825,827,830,832,834,836,839],{"class":251,"style":252},[249,826,332],{"style":311},[249,828,829],{"style":287},"status",[249,831,322],{"style":259},[249,833,703],{"style":263},[249,835,91],{"style":255},[249,837,838],{"style":263},"statusCode",[249,840,327],{"style":259},[249,842,843,845,847,849,851,853,855,857,859,861,863,865,867,870,872,874,876,879],{"class":251,"style":252},[249,844,468],{"style":259},[249,846,335],{"style":255},[249,848,112],{"style":263},[249,850,347],{"style":255},[249,852,319],{"style":287},[249,854,322],{"style":259},[249,856,362],{"style":278},[249,858,341],{"style":263},[249,860,703],{"style":263},[249,862,347],{"style":255},[249,864,730],{"style":259},[249,866,359],{"style":263},[249,868,869],{"style":278}," ",[249,871,341],{"style":263},[249,873,838],{"style":263},[249,875,359],{"style":263},[249,877,878],{"style":278}," response`",[249,880,356],{"style":259},[249,882,883,886],{"class":251,"style":252},[249,884,885],{"style":259},"      }",[249,887,371],{"style":255},[249,889,890,892,894],{"class":251,"style":252},[249,891,308],{"style":255},[249,893,359],{"style":259},[249,895,371],{"style":255},[249,897,898,900,902],{"class":251,"style":252},[249,899,295],{"style":255},[249,901,359],{"style":259},[249,903,371],{"style":255},[249,905,906],{"class":251,"style":252},[249,907,384],{"style":259},[106,909,911,912,915,916,919,920,923,924,926,927,930],{"as":910},"warning","",[48,913,914],{},"file.path"," replaces the plugin's ",[48,917,918],{},"output.path"," and ",[48,921,922],{},"group"," layout. The returned path resolves against the root ",[48,925,918],{}," and must stay inside it. Moved files get no ",[48,928,929],{},"index.ts"," barrel.",[115,932,933],{"id":66},"Macros",[10,935,936,937,940,941,944],{},"A macro rewrites schema or operation nodes before any generator runs. Define one with ",[48,938,939],{},"defineMacro"," from ",[48,942,943],{},"kubb\u002Fkit",":",[14,946,947,957],{},[17,948,949],{},[20,950,951,954],{},[23,952,953],{},"Field",[23,955,956],{},"What it does",[33,958,959,968,987,997],{},[20,960,961,965],{},[38,962,963],{},[48,964,319],{},[38,966,967],{},"Identifies the macro",[20,969,970,980],{},[38,971,972,973,976,977],{},"A callback per node kind, such as ",[48,974,975],{},"schema"," or ",[48,978,979],{},"operation",[38,981,982,983,986],{},"Returns a replacement node, or ",[48,984,985],{},"undefined"," to keep the node",[20,988,989,994],{},[38,990,991],{},[48,992,993],{},"match",[38,995,996],{},"Skips nodes the macro does not care about",[20,998,999,1004],{},[38,1000,1001],{},[48,1002,1003],{},"enforce: 'pre' | 'post'",[38,1005,1006,1007],{},"Runs the macro before or after macros without ",[48,1008,1009],{},"enforce",[10,1011,1012,1018],{},[44,1013,1015],{"href":1014},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fast#macros",[48,1016,1017],{},"ast.macro"," lists every callback.",[236,1020,1021,1253],{},[239,1022,1025],{"language":241,"filename":1023,"code":1024,"class":244},"macroIntegerToString.ts","import { ast, defineMacro } from 'kubb\u002Fkit'\n\nexport const macroIntegerToString = defineMacro({\n  name: 'integer-to-string',\n  schema(node) {\n    if (node.type !== 'integer') return undefined\n    \u002F\u002F Copy only fields a string schema has: `min`, `max`, `primitive`, and `format` mean something else on an integer.\n    const { name, title, description, nullable, optional, deprecated, readOnly, writeOnly } = node\n    return ast.factory.createSchema({ type: 'string', name, title, description, nullable, optional, deprecated, readOnly, writeOnly })\n  },\n})",[48,1026,1027,280,1048,280,1050,280,1068,280,1081,280,1093,280,1122,280,1129,280,1180,280,1242,280,1249],{"class":247},[249,1028,1029,1031,1033,1036,1038,1041,1043,1045],{"class":251,"style":252},[249,1030,256],{"style":255},[249,1032,260],{"style":259},[249,1034,1035],{"style":263},"ast",[249,1037,91],{"style":255},[249,1039,1040],{"style":263},"defineMacro ",[249,1042,272],{"style":259},[249,1044,275],{"style":255},[249,1046,1047],{"style":278},"'kubb\u002Fkit'",[249,1049],{"class":251,"style":252},[249,1051,1052,1055,1058,1061,1064,1066],{"class":251,"style":252},[249,1053,1054],{"style":255},"export ",[249,1056,1057],{"style":255},"const ",[249,1059,1060],{"style":263},"macroIntegerToString ",[249,1062,1063],{"style":255},"= ",[249,1065,939],{"style":287},[249,1067,290],{"style":259},[249,1069,1070,1072,1074,1076,1079],{"class":251,"style":252},[249,1071,295],{"style":259},[249,1073,319],{"style":259},[249,1075,300],{"style":255},[249,1077,1078],{"style":278},"'integer-to-string'",[249,1080,371],{"style":255},[249,1082,1083,1085,1087,1089,1091],{"class":251,"style":252},[249,1084,295],{"style":255},[249,1086,975],{"style":287},[249,1088,322],{"style":259},[249,1090,703],{"style":263},[249,1092,327],{"style":259},[249,1094,1095,1097,1100,1102,1104,1106,1109,1112,1115,1118,1120],{"class":251,"style":252},[249,1096,308],{"style":259},[249,1098,1099],{"style":255},"if ",[249,1101,322],{"style":259},[249,1103,703],{"style":263},[249,1105,347],{"style":255},[249,1107,1108],{"style":259},"type ",[249,1110,1111],{"style":255},"!== ",[249,1113,1114],{"style":278},"'integer'",[249,1116,1117],{"style":259},") ",[249,1119,335],{"style":255},[249,1121,985],{"style":259},[249,1123,1124,1126],{"class":251,"style":252},[249,1125,308],{"style":259},[249,1127,1128],{"style":311},"\u002F\u002F Copy only fields a string schema has: `min`, `max`, `primitive`, and `format` mean something else on an integer.",[249,1130,1131,1133,1135,1137,1139,1141,1144,1146,1149,1151,1154,1156,1159,1161,1164,1166,1169,1171,1174,1176,1178],{"class":251,"style":252},[249,1132,308],{"style":311},[249,1134,1057],{"style":255},[249,1136,260],{"style":259},[249,1138,319],{"style":263},[249,1140,91],{"style":255},[249,1142,1143],{"style":263},"title",[249,1145,91],{"style":255},[249,1147,1148],{"style":263},"description",[249,1150,91],{"style":255},[249,1152,1153],{"style":263},"nullable",[249,1155,91],{"style":255},[249,1157,1158],{"style":263},"optional",[249,1160,91],{"style":255},[249,1162,1163],{"style":263},"deprecated",[249,1165,91],{"style":255},[249,1167,1168],{"style":263},"readOnly",[249,1170,91],{"style":255},[249,1172,1173],{"style":263},"writeOnly ",[249,1175,272],{"style":259},[249,1177,1063],{"style":255},[249,1179,703],{"style":263},[249,1181,1182,1184,1186,1188,1190,1193,1195,1198,1200,1203,1205,1208,1210,1212,1214,1216,1218,1220,1222,1224,1226,1228,1230,1232,1234,1236,1238,1240],{"class":251,"style":252},[249,1183,308],{"style":263},[249,1185,335],{"style":255},[249,1187,1035],{"style":263},[249,1189,347],{"style":255},[249,1191,1192],{"style":259},"factory",[249,1194,347],{"style":255},[249,1196,1197],{"style":287},"createSchema",[249,1199,453],{"style":259},[249,1201,1202],{"style":259},"type",[249,1204,300],{"style":255},[249,1206,1207],{"style":278},"'string'",[249,1209,91],{"style":255},[249,1211,319],{"style":263},[249,1213,91],{"style":255},[249,1215,1143],{"style":263},[249,1217,91],{"style":255},[249,1219,1148],{"style":263},[249,1221,91],{"style":255},[249,1223,1153],{"style":263},[249,1225,91],{"style":255},[249,1227,1158],{"style":263},[249,1229,91],{"style":255},[249,1231,1163],{"style":263},[249,1233,91],{"style":255},[249,1235,1168],{"style":263},[249,1237,91],{"style":255},[249,1239,1173],{"style":263},[249,1241,384],{"style":259},[249,1243,1244,1247],{"class":251,"style":252},[249,1245,1246],{"style":259},"  }",[249,1248,371],{"style":255},[249,1250,1251],{"class":251,"style":252},[249,1252,384],{"style":259},[239,1254,1257],{"language":241,"filename":1255,"code":1256,"class":244},"macroUntagged.ts","import { defineMacro } from 'kubb\u002Fkit'\n\nexport const macroUntagged = defineMacro({\n  name: 'untagged',\n  enforce: 'post',\n  match: (node) => node.kind === 'Operation',\n  operation(node) {\n    return node.tags?.length ? undefined : { ...node, tags: ['untagged'] }\n  },\n})",[48,1258,1259,280,1273,280,1275,280,1290,280,1303,280,1316,280,1348,280,1360,280,1408,280,1414],{"class":247},[249,1260,1261,1263,1265,1267,1269,1271],{"class":251,"style":252},[249,1262,256],{"style":255},[249,1264,260],{"style":259},[249,1266,1040],{"style":263},[249,1268,272],{"style":259},[249,1270,275],{"style":255},[249,1272,1047],{"style":278},[249,1274],{"class":251,"style":252},[249,1276,1277,1279,1281,1284,1286,1288],{"class":251,"style":252},[249,1278,1054],{"style":255},[249,1280,1057],{"style":255},[249,1282,1283],{"style":263},"macroUntagged ",[249,1285,1063],{"style":255},[249,1287,939],{"style":287},[249,1289,290],{"style":259},[249,1291,1292,1294,1296,1298,1301],{"class":251,"style":252},[249,1293,295],{"style":259},[249,1295,319],{"style":259},[249,1297,300],{"style":255},[249,1299,1300],{"style":278},"'untagged'",[249,1302,371],{"style":255},[249,1304,1305,1307,1309,1311,1314],{"class":251,"style":252},[249,1306,295],{"style":255},[249,1308,1009],{"style":259},[249,1310,300],{"style":255},[249,1312,1313],{"style":278},"'post'",[249,1315,371],{"style":255},[249,1317,1318,1320,1322,1324,1326,1328,1330,1333,1335,1337,1340,1343,1346],{"class":251,"style":252},[249,1319,295],{"style":255},[249,1321,993],{"style":259},[249,1323,300],{"style":255},[249,1325,322],{"style":259},[249,1327,703],{"style":263},[249,1329,1117],{"style":259},[249,1331,1332],{"style":255},"=> ",[249,1334,703],{"style":263},[249,1336,347],{"style":255},[249,1338,1339],{"style":259},"kind ",[249,1341,1342],{"style":255},"=== ",[249,1344,1345],{"style":278},"'Operation'",[249,1347,371],{"style":255},[249,1349,1350,1352,1354,1356,1358],{"class":251,"style":252},[249,1351,295],{"style":255},[249,1353,979],{"style":287},[249,1355,322],{"style":259},[249,1357,703],{"style":263},[249,1359,327],{"style":259},[249,1361,1362,1364,1366,1368,1370,1373,1376,1379,1382,1385,1387,1389,1392,1394,1396,1398,1400,1403,1405],{"class":251,"style":252},[249,1363,308],{"style":259},[249,1365,335],{"style":255},[249,1367,703],{"style":263},[249,1369,347],{"style":255},[249,1371,1372],{"style":259},"tags",[249,1374,1375],{"style":255},"?.",[249,1377,1378],{"style":259},"length ",[249,1380,1381],{"style":255},"? ",[249,1383,1384],{"style":259},"undefined ",[249,1386,300],{"style":255},[249,1388,260],{"style":259},[249,1390,1391],{"style":255},"...",[249,1393,703],{"style":263},[249,1395,91],{"style":255},[249,1397,1372],{"style":259},[249,1399,300],{"style":255},[249,1401,1402],{"style":259},"[",[249,1404,1300],{"style":278},[249,1406,1407],{"style":259},"] }",[249,1409,1410,1412],{"class":251,"style":252},[249,1411,1246],{"style":259},[249,1413,371],{"style":255},[249,1415,1416],{"class":251,"style":252},[249,1417,384],{"style":259},[1419,1420,1422],"h3",{"id":1421},"register-a-macro","Register a macro",[10,1424,1425,1426,1428,1429,1432,1433,976,1436,1439],{},"Pass macros through a plugin's ",[48,1427,66],{}," option, or register them in your own plugin's ",[48,1430,1431],{},"setup"," with ",[48,1434,1435],{},"kubb.addMacro",[48,1437,1438],{},"kubb.setMacros",". Macros run per plugin, so they never change the nodes another plugin sees.",[239,1441,1444],{"language":241,"filename":1442,"code":1443,"class":244},"plugin.ts","import { defineExtension, defineMacro } from 'kubb\u002Fkit'\n\nconst macroDropDescriptions = defineMacro({\n  name: 'drop-descriptions',\n  schema(node) {\n    return 'description' in node && node.description ? { ...node, description: undefined } : undefined\n  },\n})\n\nexport const pluginRename = defineExtension({\n  kind: 'plugin',\n  meta: { name: 'plugin-rename' },\n  setup(options, kubb) {\n    kubb.addMacro(macroDropDescriptions)\n    return options\n  },\n})",[48,1445,1446,280,1465,280,1467,280,1480,280,1493,280,1505,280,1552,280,1560,280,1564,280,1566,280,1581,280,1595,280,1617,280,1635,280,1653,280,1661,280,1669],{"class":247},[249,1447,1448,1450,1452,1455,1457,1459,1461,1463],{"class":251,"style":252},[249,1449,256],{"style":255},[249,1451,260],{"style":259},[249,1453,1454],{"style":263},"defineExtension",[249,1456,91],{"style":255},[249,1458,1040],{"style":263},[249,1460,272],{"style":259},[249,1462,275],{"style":255},[249,1464,1047],{"style":278},[249,1466],{"class":251,"style":252},[249,1468,1469,1471,1474,1476,1478],{"class":251,"style":252},[249,1470,1057],{"style":255},[249,1472,1473],{"style":263},"macroDropDescriptions ",[249,1475,1063],{"style":255},[249,1477,939],{"style":287},[249,1479,290],{"style":259},[249,1481,1482,1484,1486,1488,1491],{"class":251,"style":252},[249,1483,295],{"style":259},[249,1485,319],{"style":259},[249,1487,300],{"style":255},[249,1489,1490],{"style":278},"'drop-descriptions'",[249,1492,371],{"style":255},[249,1494,1495,1497,1499,1501,1503],{"class":251,"style":252},[249,1496,295],{"style":255},[249,1498,975],{"style":287},[249,1500,322],{"style":259},[249,1502,703],{"style":263},[249,1504,327],{"style":259},[249,1506,1507,1509,1511,1514,1517,1520,1523,1525,1527,1530,1532,1534,1536,1538,1540,1542,1544,1546,1548,1550],{"class":251,"style":252},[249,1508,308],{"style":259},[249,1510,335],{"style":255},[249,1512,1513],{"style":278},"'description' ",[249,1515,1516],{"style":255},"in ",[249,1518,1519],{"style":263},"node ",[249,1521,1522],{"style":255},"&& ",[249,1524,703],{"style":263},[249,1526,347],{"style":255},[249,1528,1529],{"style":259},"description ",[249,1531,1381],{"style":255},[249,1533,260],{"style":259},[249,1535,1391],{"style":255},[249,1537,703],{"style":263},[249,1539,91],{"style":255},[249,1541,1148],{"style":259},[249,1543,300],{"style":255},[249,1545,1384],{"style":259},[249,1547,272],{"style":259},[249,1549,300],{"style":255},[249,1551,985],{"style":259},[249,1553,1554,1556,1558],{"class":251,"style":252},[249,1555,295],{"style":259},[249,1557,359],{"style":259},[249,1559,371],{"style":255},[249,1561,1562],{"class":251,"style":252},[249,1563,384],{"style":259},[249,1565],{"class":251,"style":252},[249,1567,1568,1570,1572,1575,1577,1579],{"class":251,"style":252},[249,1569,1054],{"style":255},[249,1571,1057],{"style":255},[249,1573,1574],{"style":263},"pluginRename ",[249,1576,1063],{"style":255},[249,1578,1454],{"style":287},[249,1580,290],{"style":259},[249,1582,1583,1585,1588,1590,1593],{"class":251,"style":252},[249,1584,295],{"style":259},[249,1586,1587],{"style":259},"kind",[249,1589,300],{"style":255},[249,1591,1592],{"style":278},"'plugin'",[249,1594,371],{"style":255},[249,1596,1597,1599,1602,1604,1606,1608,1610,1613,1615],{"class":251,"style":252},[249,1598,295],{"style":255},[249,1600,1601],{"style":259},"meta",[249,1603,300],{"style":255},[249,1605,260],{"style":259},[249,1607,319],{"style":259},[249,1609,300],{"style":255},[249,1611,1612],{"style":278},"'plugin-rename' ",[249,1614,359],{"style":259},[249,1616,371],{"style":255},[249,1618,1619,1621,1623,1625,1628,1630,1633],{"class":251,"style":252},[249,1620,295],{"style":255},[249,1622,1431],{"style":287},[249,1624,322],{"style":259},[249,1626,1627],{"style":263},"options",[249,1629,91],{"style":255},[249,1631,1632],{"style":263},"kubb",[249,1634,327],{"style":259},[249,1636,1637,1639,1641,1643,1646,1648,1651],{"class":251,"style":252},[249,1638,308],{"style":259},[249,1640,1632],{"style":263},[249,1642,347],{"style":255},[249,1644,1645],{"style":287},"addMacro",[249,1647,322],{"style":259},[249,1649,1650],{"style":263},"macroDropDescriptions",[249,1652,356],{"style":259},[249,1654,1655,1657,1659],{"class":251,"style":252},[249,1656,308],{"style":259},[249,1658,335],{"style":255},[249,1660,1627],{"style":263},[249,1662,1663,1665,1667],{"class":251,"style":252},[249,1664,295],{"style":263},[249,1666,359],{"style":259},[249,1668,371],{"style":255},[249,1670,1671],{"class":251,"style":252},[249,1672,384],{"style":259},[10,1674,1675,1676,919,1679,1681,1682,1685],{},"The diagram applies ",[48,1677,1678],{},"macroIntegerToString",[48,1680,1650],{}," to a ",[48,1683,1684],{},"Pet"," node. Hover a line to see which macro changed it.",[1687,1688],"flow-diagram",{"preset":66},[106,1690,1691],{"as":108},"Keep macros pure. Return a new node instead of mutating the input, because every plugin shares the same AST nodes.",[1419,1693,1695],{"id":1694},"rename-a-schema","Rename a schema",[106,1697,1698,1699,1702,1703,1706],{"as":910},"Renaming only the declaration leaves every ",[48,1700,1701],{},"$ref"," on the old name, so imports point at a file the plugin no longer writes. Rename the declaration and set ",[48,1704,1705],{},"targetName"," on every ref in one macro, and register it on every plugin that reads the schema.",[10,1708,1709,1712,1713,1715],{},[48,1710,1711],{},"macroRenameSchema"," does both. Pass one shared ",[48,1714,66],{}," array to each plugin:",[236,1717,1718,2107],{},[239,1719,1722],{"language":241,"filename":1720,"code":1721,"class":244},"macroRenameSchema.ts","import { ast, defineMacro } from 'kubb\u002Fkit'\n\nexport function macroRenameSchema({ from, to }: { from: string; to: string }) {\n  return defineMacro({\n    name: 'rename-schema',\n    schema(node) {\n      const refNode = ast.schema.narrow(node, 'ref')\n\n      if (!refNode) {\n        return node.name === from ? { ...node, name: to } : undefined\n      }\n\n      \u002F\u002F A ref node can be the renamed schema's own declaration, a pointer to it, or both at once.\n      const renamesDeclaration = refNode.name === from\n      const renamesTarget = ast.ref.getName(refNode) === from\n      if (!renamesDeclaration && !renamesTarget) return undefined\n\n      return {\n        ...refNode,\n        ...(renamesDeclaration ? { name: to } : {}),\n        ...(renamesTarget ? { targetName: to } : {}),\n      }\n    },\n  })\n}",[48,1723,1724,280,1742,280,1744,280,1789,280,1799,280,1812,280,1824,280,1857,280,1859,280,1875,280,1914,280,1920,280,1922,280,1929,280,1950,280,1983,280,2007,280,2009,280,2017,280,2027,280,2056,280,2084,280,2090,280,2097,280,2103],{"class":247},[249,1725,1726,1728,1730,1732,1734,1736,1738,1740],{"class":251,"style":252},[249,1727,256],{"style":255},[249,1729,260],{"style":259},[249,1731,1035],{"style":263},[249,1733,91],{"style":255},[249,1735,1040],{"style":263},[249,1737,272],{"style":259},[249,1739,275],{"style":255},[249,1741,1047],{"style":278},[249,1743],{"class":251,"style":252},[249,1745,1746,1748,1751,1753,1755,1758,1760,1763,1765,1767,1769,1771,1773,1776,1779,1782,1784,1787],{"class":251,"style":252},[249,1747,1054],{"style":255},[249,1749,1750],{"style":255},"function ",[249,1752,1711],{"style":287},[249,1754,453],{"style":259},[249,1756,1757],{"style":263},"from",[249,1759,91],{"style":255},[249,1761,1762],{"style":263},"to ",[249,1764,359],{"style":259},[249,1766,300],{"style":255},[249,1768,260],{"style":259},[249,1770,1757],{"style":259},[249,1772,300],{"style":263},[249,1774,1775],{"style":287},"string",[249,1777,1778],{"style":255},"; ",[249,1780,1781],{"style":259},"to",[249,1783,300],{"style":263},[249,1785,1786],{"style":287},"string ",[249,1788,463],{"style":259},[249,1790,1791,1793,1795,1797],{"class":251,"style":252},[249,1792,295],{"style":259},[249,1794,335],{"style":255},[249,1796,939],{"style":287},[249,1798,290],{"style":259},[249,1800,1801,1803,1805,1807,1810],{"class":251,"style":252},[249,1802,308],{"style":259},[249,1804,319],{"style":259},[249,1806,300],{"style":255},[249,1808,1809],{"style":278},"'rename-schema'",[249,1811,371],{"style":255},[249,1813,1814,1816,1818,1820,1822],{"class":251,"style":252},[249,1815,308],{"style":255},[249,1817,975],{"style":287},[249,1819,322],{"style":259},[249,1821,703],{"style":263},[249,1823,327],{"style":259},[249,1825,1826,1828,1830,1833,1835,1837,1839,1841,1843,1846,1848,1850,1852,1855],{"class":251,"style":252},[249,1827,332],{"style":259},[249,1829,1057],{"style":255},[249,1831,1832],{"style":263},"refNode ",[249,1834,1063],{"style":255},[249,1836,1035],{"style":263},[249,1838,347],{"style":255},[249,1840,975],{"style":259},[249,1842,347],{"style":255},[249,1844,1845],{"style":287},"narrow",[249,1847,322],{"style":259},[249,1849,703],{"style":263},[249,1851,91],{"style":255},[249,1853,1854],{"style":278},"'ref'",[249,1856,356],{"style":259},[249,1858],{"class":251,"style":252},[249,1860,1861,1863,1865,1867,1870,1873],{"class":251,"style":252},[249,1862,332],{"style":259},[249,1864,1099],{"style":255},[249,1866,322],{"style":259},[249,1868,1869],{"style":255},"!",[249,1871,1872],{"style":263},"refNode",[249,1874,327],{"style":259},[249,1876,1877,1879,1881,1883,1885,1888,1890,1892,1894,1896,1898,1900,1902,1904,1906,1908,1910,1912],{"class":251,"style":252},[249,1878,468],{"style":259},[249,1880,335],{"style":255},[249,1882,703],{"style":263},[249,1884,347],{"style":255},[249,1886,1887],{"style":259},"name ",[249,1889,1342],{"style":255},[249,1891,275],{"style":263},[249,1893,1381],{"style":255},[249,1895,260],{"style":259},[249,1897,1391],{"style":255},[249,1899,703],{"style":263},[249,1901,91],{"style":255},[249,1903,319],{"style":259},[249,1905,300],{"style":255},[249,1907,1762],{"style":263},[249,1909,272],{"style":259},[249,1911,300],{"style":255},[249,1913,985],{"style":259},[249,1915,1916,1918],{"class":251,"style":252},[249,1917,332],{"style":259},[249,1919,359],{"style":259},[249,1921],{"class":251,"style":252},[249,1923,1924,1926],{"class":251,"style":252},[249,1925,332],{"style":259},[249,1927,1928],{"style":311},"\u002F\u002F A ref node can be the renamed schema's own declaration, a pointer to it, or both at once.",[249,1930,1931,1933,1935,1938,1940,1942,1944,1946,1948],{"class":251,"style":252},[249,1932,332],{"style":311},[249,1934,1057],{"style":255},[249,1936,1937],{"style":263},"renamesDeclaration ",[249,1939,1063],{"style":255},[249,1941,1872],{"style":263},[249,1943,347],{"style":255},[249,1945,1887],{"style":259},[249,1947,1342],{"style":255},[249,1949,1757],{"style":263},[249,1951,1952,1954,1956,1959,1961,1963,1965,1968,1970,1973,1975,1977,1979,1981],{"class":251,"style":252},[249,1953,332],{"style":263},[249,1955,1057],{"style":255},[249,1957,1958],{"style":263},"renamesTarget ",[249,1960,1063],{"style":255},[249,1962,1035],{"style":263},[249,1964,347],{"style":255},[249,1966,1967],{"style":259},"ref",[249,1969,347],{"style":255},[249,1971,1972],{"style":287},"getName",[249,1974,322],{"style":259},[249,1976,1872],{"style":263},[249,1978,1117],{"style":259},[249,1980,1342],{"style":255},[249,1982,1757],{"style":263},[249,1984,1985,1987,1989,1991,1993,1995,1998,2001,2003,2005],{"class":251,"style":252},[249,1986,332],{"style":263},[249,1988,1099],{"style":255},[249,1990,322],{"style":259},[249,1992,1869],{"style":255},[249,1994,1937],{"style":263},[249,1996,1997],{"style":255},"&& !",[249,1999,2000],{"style":263},"renamesTarget",[249,2002,1117],{"style":259},[249,2004,335],{"style":255},[249,2006,985],{"style":259},[249,2008],{"class":251,"style":252},[249,2010,2011,2013,2015],{"class":251,"style":252},[249,2012,332],{"style":259},[249,2014,335],{"style":255},[249,2016,303],{"style":259},[249,2018,2019,2021,2023,2025],{"class":251,"style":252},[249,2020,468],{"style":259},[249,2022,1391],{"style":255},[249,2024,1872],{"style":263},[249,2026,371],{"style":255},[249,2028,2029,2031,2033,2035,2037,2039,2041,2043,2045,2047,2049,2051,2054],{"class":251,"style":252},[249,2030,468],{"style":255},[249,2032,1391],{"style":255},[249,2034,322],{"style":259},[249,2036,1937],{"style":263},[249,2038,1381],{"style":255},[249,2040,260],{"style":259},[249,2042,319],{"style":259},[249,2044,300],{"style":255},[249,2046,1762],{"style":263},[249,2048,272],{"style":259},[249,2050,300],{"style":255},[249,2052,2053],{"style":259},"{})",[249,2055,371],{"style":255},[249,2057,2058,2060,2062,2064,2066,2068,2070,2072,2074,2076,2078,2080,2082],{"class":251,"style":252},[249,2059,468],{"style":255},[249,2061,1391],{"style":255},[249,2063,322],{"style":259},[249,2065,1958],{"style":263},[249,2067,1381],{"style":255},[249,2069,260],{"style":259},[249,2071,1705],{"style":259},[249,2073,300],{"style":255},[249,2075,1762],{"style":263},[249,2077,272],{"style":259},[249,2079,300],{"style":255},[249,2081,2053],{"style":259},[249,2083,371],{"style":255},[249,2085,2086,2088],{"class":251,"style":252},[249,2087,332],{"style":255},[249,2089,359],{"style":259},[249,2091,2092,2095],{"class":251,"style":252},[249,2093,2094],{"style":259},"    }",[249,2096,371],{"style":255},[249,2098,2099,2101],{"class":251,"style":252},[249,2100,295],{"style":255},[249,2102,384],{"style":259},[249,2104,2105],{"class":251,"style":252},[249,2106,359],{"style":259},[239,2108,2111],{"language":241,"filename":2109,"code":2110,"class":244},"kubb.config.ts","import { defineConfig } from 'kubb\u002Fconfig'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\nimport { pluginZod } from '@kubb\u002Fplugin-zod'\nimport { macroRenameSchema } from '.\u002FmacroRenameSchema.ts'\n\nconst macros = [macroRenameSchema({ from: 'Order', to: 'StoreOrder' })]\n\nexport default defineConfig({\n  input: '.\u002FpetStore.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen' },\n  plugins: [pluginTs({ macros }), pluginZod({ macros })],\n})",[48,2112,2113,280,2129,280,2143,280,2159,280,2175,280,2177,280,2211,280,2213,280,2225,280,2239,280,2261,280,2293],{"class":247},[249,2114,2115,2117,2119,2122,2124,2126],{"class":251,"style":252},[249,2116,256],{"style":255},[249,2118,260],{"style":259},[249,2120,2121],{"style":263},"defineConfig ",[249,2123,272],{"style":259},[249,2125,275],{"style":255},[249,2127,2128],{"style":278},"'kubb\u002Fconfig'",[249,2130,2131,2133,2135,2137,2139,2141],{"class":251,"style":252},[249,2132,256],{"style":255},[249,2134,260],{"style":259},[249,2136,780],{"style":263},[249,2138,272],{"style":259},[249,2140,275],{"style":255},[249,2142,279],{"style":278},[249,2144,2145,2147,2149,2152,2154,2156],{"class":251,"style":252},[249,2146,256],{"style":255},[249,2148,260],{"style":259},[249,2150,2151],{"style":263},"pluginZod ",[249,2153,272],{"style":259},[249,2155,275],{"style":255},[249,2157,2158],{"style":278},"'@kubb\u002Fplugin-zod'",[249,2160,2161,2163,2165,2168,2170,2172],{"class":251,"style":252},[249,2162,256],{"style":255},[249,2164,260],{"style":259},[249,2166,2167],{"style":263},"macroRenameSchema ",[249,2169,272],{"style":259},[249,2171,275],{"style":255},[249,2173,2174],{"style":278},"'.\u002FmacroRenameSchema.ts'",[249,2176],{"class":251,"style":252},[249,2178,2179,2181,2184,2186,2188,2190,2192,2194,2196,2199,2201,2203,2205,2208],{"class":251,"style":252},[249,2180,1057],{"style":255},[249,2182,2183],{"style":263},"macros ",[249,2185,1063],{"style":255},[249,2187,1402],{"style":259},[249,2189,1711],{"style":287},[249,2191,453],{"style":259},[249,2193,1757],{"style":259},[249,2195,300],{"style":255},[249,2197,2198],{"style":278},"'Order'",[249,2200,91],{"style":255},[249,2202,1781],{"style":259},[249,2204,300],{"style":255},[249,2206,2207],{"style":278},"'StoreOrder' ",[249,2209,2210],{"style":259},"})]",[249,2212],{"class":251,"style":252},[249,2214,2215,2217,2220,2223],{"class":251,"style":252},[249,2216,1054],{"style":255},[249,2218,2219],{"style":255},"default ",[249,2221,2222],{"style":287},"defineConfig",[249,2224,290],{"style":259},[249,2226,2227,2229,2232,2234,2237],{"class":251,"style":252},[249,2228,295],{"style":259},[249,2230,2231],{"style":259},"input",[249,2233,300],{"style":255},[249,2235,2236],{"style":278},"'.\u002FpetStore.yaml'",[249,2238,371],{"style":255},[249,2240,2241,2243,2246,2248,2250,2252,2254,2257,2259],{"class":251,"style":252},[249,2242,295],{"style":255},[249,2244,2245],{"style":259},"output",[249,2247,300],{"style":255},[249,2249,260],{"style":259},[249,2251,580],{"style":259},[249,2253,300],{"style":255},[249,2255,2256],{"style":278},"'.\u002Fsrc\u002Fgen' ",[249,2258,359],{"style":259},[249,2260,371],{"style":255},[249,2262,2263,2265,2268,2270,2272,2274,2276,2278,2280,2282,2285,2287,2289,2291],{"class":251,"style":252},[249,2264,295],{"style":255},[249,2266,2267],{"style":259},"plugins",[249,2269,300],{"style":255},[249,2271,1402],{"style":259},[249,2273,264],{"style":287},[249,2275,453],{"style":259},[249,2277,2183],{"style":263},[249,2279,384],{"style":259},[249,2281,91],{"style":255},[249,2283,2284],{"style":287},"pluginZod",[249,2286,453],{"style":259},[249,2288,2183],{"style":263},[249,2290,2210],{"style":259},[249,2292,371],{"style":255},[249,2294,2295],{"class":251,"style":252},[249,2296,384],{"style":259},[1419,2298,2300],{"id":2299},"use-the-built-in-macros","Use the built-in macros",[10,2302,2303,2305,2306,2309],{},[48,2304,943],{}," exports ",[44,2307,2308],{"href":1014},"built-in macros"," for common normalizations. Combine them with your own:",[239,2311,2313],{"language":241,"filename":2109,"code":2312,"class":244},"import { defineConfig } from 'kubb\u002Fconfig'\nimport { macroDedupeUnion, macroDiscriminatorEnum } from 'kubb\u002Fkit'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\n\nexport default defineConfig({\n  input: '.\u002FpetStore.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen' },\n  plugins: [\n    pluginTs({\n      macros: [macroDedupeUnion, macroDiscriminatorEnum({ propertyName: 'kind', values: ['cat', 'dog'] })],\n    }),\n  ],\n})",[48,2314,2315,280,2329,280,2349,280,2363,280,2365,280,2375,280,2387,280,2407,280,2417,280,2425,280,2474,280,2482,280,2491],{"class":247},[249,2316,2317,2319,2321,2323,2325,2327],{"class":251,"style":252},[249,2318,256],{"style":255},[249,2320,260],{"style":259},[249,2322,2121],{"style":263},[249,2324,272],{"style":259},[249,2326,275],{"style":255},[249,2328,2128],{"style":278},[249,2330,2331,2333,2335,2338,2340,2343,2345,2347],{"class":251,"style":252},[249,2332,256],{"style":255},[249,2334,260],{"style":259},[249,2336,2337],{"style":263},"macroDedupeUnion",[249,2339,91],{"style":255},[249,2341,2342],{"style":263},"macroDiscriminatorEnum ",[249,2344,272],{"style":259},[249,2346,275],{"style":255},[249,2348,1047],{"style":278},[249,2350,2351,2353,2355,2357,2359,2361],{"class":251,"style":252},[249,2352,256],{"style":255},[249,2354,260],{"style":259},[249,2356,780],{"style":263},[249,2358,272],{"style":259},[249,2360,275],{"style":255},[249,2362,279],{"style":278},[249,2364],{"class":251,"style":252},[249,2366,2367,2369,2371,2373],{"class":251,"style":252},[249,2368,1054],{"style":255},[249,2370,2219],{"style":255},[249,2372,2222],{"style":287},[249,2374,290],{"style":259},[249,2376,2377,2379,2381,2383,2385],{"class":251,"style":252},[249,2378,295],{"style":259},[249,2380,2231],{"style":259},[249,2382,300],{"style":255},[249,2384,2236],{"style":278},[249,2386,371],{"style":255},[249,2388,2389,2391,2393,2395,2397,2399,2401,2403,2405],{"class":251,"style":252},[249,2390,295],{"style":255},[249,2392,2245],{"style":259},[249,2394,300],{"style":255},[249,2396,260],{"style":259},[249,2398,580],{"style":259},[249,2400,300],{"style":255},[249,2402,2256],{"style":278},[249,2404,359],{"style":259},[249,2406,371],{"style":255},[249,2408,2409,2411,2413,2415],{"class":251,"style":252},[249,2410,295],{"style":255},[249,2412,2267],{"style":259},[249,2414,300],{"style":255},[249,2416,1402],{"style":259},[249,2418,2419,2421,2423],{"class":251,"style":252},[249,2420,308],{"style":259},[249,2422,264],{"style":287},[249,2424,290],{"style":259},[249,2426,2427,2429,2431,2433,2435,2437,2439,2442,2444,2447,2449,2452,2454,2457,2459,2461,2464,2466,2469,2472],{"class":251,"style":252},[249,2428,332],{"style":259},[249,2430,66],{"style":259},[249,2432,300],{"style":255},[249,2434,1402],{"style":259},[249,2436,2337],{"style":263},[249,2438,91],{"style":255},[249,2440,2441],{"style":287},"macroDiscriminatorEnum",[249,2443,453],{"style":259},[249,2445,2446],{"style":259},"propertyName",[249,2448,300],{"style":255},[249,2450,2451],{"style":278},"'kind'",[249,2453,91],{"style":255},[249,2455,2456],{"style":259},"values",[249,2458,300],{"style":255},[249,2460,1402],{"style":259},[249,2462,2463],{"style":278},"'cat'",[249,2465,91],{"style":255},[249,2467,2468],{"style":278},"'dog'",[249,2470,2471],{"style":259},"] })]",[249,2473,371],{"style":255},[249,2475,2476,2478,2480],{"class":251,"style":252},[249,2477,308],{"style":255},[249,2479,384],{"style":259},[249,2481,371],{"style":255},[249,2483,2484,2486,2489],{"class":251,"style":252},[249,2485,295],{"style":255},[249,2487,2488],{"style":259},"]",[249,2490,371],{"style":255},[249,2492,2493],{"class":251,"style":252},[249,2494,384],{"style":259},[115,2496,2498],{"id":2497},"printers","Printers",[10,2500,2501,2503,2504,976,2506,2509,2510,347],{},[48,2502,85],{}," replaces the handler that prints one schema type, such as ",[48,2505,77],{},[48,2507,2508],{},"object",". A handler returns code as a string. To change the schema itself, use ",[44,2511,66],{"href":63},[14,2513,2514,2526],{},[17,2515,2516],{},[20,2517,2518,2520,2523],{},[23,2519,139],{},[23,2521,2522],{},"A handler returns",[23,2524,2525],{},"Inside a handler",[33,2527,2528,2543,2569],{},[20,2529,2530,2534,2537],{},[38,2531,2532],{},[48,2533,90],{},[38,2535,2536],{},"A TypeScript type",[38,2538,2539,2542],{},[48,2540,2541],{},"this.transform(node)",": a nested node's printed type",[20,2544,2545,2549,2555],{},[38,2546,2547],{},[48,2548,94],{},[38,2550,2551,2552],{},"A Zod expression, Zod Mini with ",[48,2553,2554],{},"mini: true",[38,2556,2557,2560,2561,2564,2565,347],{},[48,2558,2559],{},"this.base(node)",": the default output. ",[48,2562,2563],{},"this.options.direction",": see ",[44,2566,2568],{"href":2567},"#zod-encode-and-decode","Zod encode and decode",[20,2570,2571,2575,2578],{},[38,2572,2573],{},[48,2574,97],{},[38,2576,2577],{},"A Faker expression",[38,2579,2580,91,2582],{},[48,2581,2541],{},[48,2583,2584],{},"this.options",[10,2586,2587,2591],{},[44,2588,2590],{"href":2589},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fast#printer-handlers-and-context","Printer handlers and context"," has the full context.",[236,2593,2594,2697,2874],{},[239,2595,2598],{"language":241,"filename":2596,"code":2597,"class":244},"plugin-ts","import { pluginTs } from '@kubb\u002Fplugin-ts'\n\npluginTs({\n  printer: {\n    nodes: {\n      \u002F\u002F A JavaScript Date instead of string\n      date() {\n        return 'Date'\n      },\n    },\n  },\n})",[48,2599,2600,280,2614,280,2616,280,2622,280,2633,280,2644,280,2651,280,2660,280,2669,280,2677,280,2685,280,2693],{"class":247},[249,2601,2602,2604,2606,2608,2610,2612],{"class":251,"style":252},[249,2603,256],{"style":255},[249,2605,260],{"style":259},[249,2607,780],{"style":263},[249,2609,272],{"style":259},[249,2611,275],{"style":255},[249,2613,279],{"style":278},[249,2615],{"class":251,"style":252},[249,2617,2618,2620],{"class":251,"style":252},[249,2619,264],{"style":287},[249,2621,290],{"style":259},[249,2623,2624,2626,2629,2631],{"class":251,"style":252},[249,2625,295],{"style":259},[249,2627,2628],{"style":259},"printer",[249,2630,300],{"style":255},[249,2632,303],{"style":259},[249,2634,2635,2637,2640,2642],{"class":251,"style":252},[249,2636,308],{"style":259},[249,2638,2639],{"style":259},"nodes",[249,2641,300],{"style":255},[249,2643,303],{"style":259},[249,2645,2646,2648],{"class":251,"style":252},[249,2647,332],{"style":259},[249,2649,2650],{"style":311},"\u002F\u002F A JavaScript Date instead of string",[249,2652,2653,2655,2657],{"class":251,"style":252},[249,2654,332],{"style":311},[249,2656,77],{"style":287},[249,2658,2659],{"style":259},"() {",[249,2661,2662,2664,2666],{"class":251,"style":252},[249,2663,468],{"style":259},[249,2665,335],{"style":255},[249,2667,2668],{"style":278},"'Date'",[249,2670,2671,2673,2675],{"class":251,"style":252},[249,2672,332],{"style":278},[249,2674,359],{"style":259},[249,2676,371],{"style":255},[249,2678,2679,2681,2683],{"class":251,"style":252},[249,2680,308],{"style":255},[249,2682,359],{"style":259},[249,2684,371],{"style":255},[249,2686,2687,2689,2691],{"class":251,"style":252},[249,2688,295],{"style":255},[249,2690,359],{"style":259},[249,2692,371],{"style":255},[249,2694,2695],{"class":251,"style":252},[249,2696,384],{"style":259},[239,2698,2701],{"language":241,"filename":2699,"code":2700,"class":244},"plugin-zod","import { pluginZod } from '@kubb\u002Fplugin-zod'\n\npluginZod({\n  printer: {\n    nodes: {\n      date() {\n        return 'z.iso.date()'\n      },\n      \u002F\u002F Decorate the default output. Nested nodes still print through the regular handlers.\n      object(node) {\n        return `${this.base(node)}.openapi(${JSON.stringify({ description: node.description })})`\n      },\n    },\n  },\n})",[48,2702,2703,280,2717,280,2719,280,2725,280,2735,280,2745,280,2753,280,2762,280,2770,280,2777,280,2789,280,2846,280,2854,280,2862,280,2870],{"class":247},[249,2704,2705,2707,2709,2711,2713,2715],{"class":251,"style":252},[249,2706,256],{"style":255},[249,2708,260],{"style":259},[249,2710,2151],{"style":263},[249,2712,272],{"style":259},[249,2714,275],{"style":255},[249,2716,2158],{"style":278},[249,2718],{"class":251,"style":252},[249,2720,2721,2723],{"class":251,"style":252},[249,2722,2284],{"style":287},[249,2724,290],{"style":259},[249,2726,2727,2729,2731,2733],{"class":251,"style":252},[249,2728,295],{"style":259},[249,2730,2628],{"style":259},[249,2732,300],{"style":255},[249,2734,303],{"style":259},[249,2736,2737,2739,2741,2743],{"class":251,"style":252},[249,2738,308],{"style":259},[249,2740,2639],{"style":259},[249,2742,300],{"style":255},[249,2744,303],{"style":259},[249,2746,2747,2749,2751],{"class":251,"style":252},[249,2748,332],{"style":259},[249,2750,77],{"style":287},[249,2752,2659],{"style":259},[249,2754,2755,2757,2759],{"class":251,"style":252},[249,2756,468],{"style":259},[249,2758,335],{"style":255},[249,2760,2761],{"style":278},"'z.iso.date()'",[249,2763,2764,2766,2768],{"class":251,"style":252},[249,2765,332],{"style":278},[249,2767,359],{"style":259},[249,2769,371],{"style":255},[249,2771,2772,2774],{"class":251,"style":252},[249,2773,332],{"style":255},[249,2775,2776],{"style":311},"\u002F\u002F Decorate the default output. Nested nodes still print through the regular handlers.",[249,2778,2779,2781,2783,2785,2787],{"class":251,"style":252},[249,2780,332],{"style":311},[249,2782,2508],{"style":287},[249,2784,322],{"style":259},[249,2786,703],{"style":263},[249,2788,327],{"style":259},[249,2790,2791,2793,2795,2797,2799,2801,2803,2806,2808,2810,2812,2814,2817,2819,2822,2824,2827,2829,2831,2833,2835,2837,2839,2841,2843],{"class":251,"style":252},[249,2792,468],{"style":259},[249,2794,335],{"style":255},[249,2796,362],{"style":278},[249,2798,341],{"style":263},[249,2800,112],{"style":263},[249,2802,347],{"style":255},[249,2804,2805],{"style":287},"base",[249,2807,322],{"style":259},[249,2809,703],{"style":263},[249,2811,356],{"style":259},[249,2813,359],{"style":263},[249,2815,2816],{"style":278},".openapi(",[249,2818,341],{"style":263},[249,2820,2821],{"style":259},"JSON",[249,2823,347],{"style":255},[249,2825,2826],{"style":287},"stringify",[249,2828,453],{"style":259},[249,2830,1148],{"style":259},[249,2832,300],{"style":255},[249,2834,703],{"style":263},[249,2836,347],{"style":255},[249,2838,1529],{"style":259},[249,2840,384],{"style":259},[249,2842,359],{"style":263},[249,2844,2845],{"style":278},")`",[249,2847,2848,2850,2852],{"class":251,"style":252},[249,2849,332],{"style":278},[249,2851,359],{"style":259},[249,2853,371],{"style":255},[249,2855,2856,2858,2860],{"class":251,"style":252},[249,2857,308],{"style":255},[249,2859,359],{"style":259},[249,2861,371],{"style":255},[249,2863,2864,2866,2868],{"class":251,"style":252},[249,2865,295],{"style":255},[249,2867,359],{"style":259},[249,2869,371],{"style":255},[249,2871,2872],{"class":251,"style":252},[249,2873,384],{"style":259},[239,2875,2878],{"language":241,"filename":2876,"code":2877,"class":244},"plugin-faker","import { pluginFaker } from '@kubb\u002Fplugin-faker'\n\npluginFaker({\n  printer: {\n    nodes: {\n      \u002F\u002F Floats where the spec declares integers\n      integer() {\n        return 'faker.number.float()'\n      },\n    },\n  },\n})",[48,2879,2880,280,2894,280,2896,280,2902,280,2912,280,2922,280,2929,280,2938,280,2947,280,2955,280,2963,280,2971],{"class":247},[249,2881,2882,2884,2886,2888,2890,2892],{"class":251,"style":252},[249,2883,256],{"style":255},[249,2885,260],{"style":259},[249,2887,399],{"style":263},[249,2889,272],{"style":259},[249,2891,275],{"style":255},[249,2893,406],{"style":278},[249,2895],{"class":251,"style":252},[249,2897,2898,2900],{"class":251,"style":252},[249,2899,413],{"style":287},[249,2901,290],{"style":259},[249,2903,2904,2906,2908,2910],{"class":251,"style":252},[249,2905,295],{"style":259},[249,2907,2628],{"style":259},[249,2909,300],{"style":255},[249,2911,303],{"style":259},[249,2913,2914,2916,2918,2920],{"class":251,"style":252},[249,2915,308],{"style":259},[249,2917,2639],{"style":259},[249,2919,300],{"style":255},[249,2921,303],{"style":259},[249,2923,2924,2926],{"class":251,"style":252},[249,2925,332],{"style":259},[249,2927,2928],{"style":311},"\u002F\u002F Floats where the spec declares integers",[249,2930,2931,2933,2936],{"class":251,"style":252},[249,2932,332],{"style":311},[249,2934,2935],{"style":287},"integer",[249,2937,2659],{"style":259},[249,2939,2940,2942,2944],{"class":251,"style":252},[249,2941,468],{"style":259},[249,2943,335],{"style":255},[249,2945,2946],{"style":278},"'faker.number.float()'",[249,2948,2949,2951,2953],{"class":251,"style":252},[249,2950,332],{"style":278},[249,2952,359],{"style":259},[249,2954,371],{"style":255},[249,2956,2957,2959,2961],{"class":251,"style":252},[249,2958,308],{"style":255},[249,2960,359],{"style":259},[249,2962,371],{"style":255},[249,2964,2965,2967,2969],{"class":251,"style":252},[249,2966,295],{"style":255},[249,2968,359],{"style":259},[249,2970,371],{"style":255},[249,2972,2973],{"class":251,"style":252},[249,2974,384],{"style":259},[1419,2976,2978],{"id":2977},"typescript-handlers","TypeScript handlers",[10,2980,2981,2983,2984,2987],{},[48,2982,2541],{}," returns a string, so a handler that passes it to ",[48,2985,2986],{},"ts.factory"," breaks. Build the type as a string.",[106,2989,2990,2991,347],{"as":910},"Returning a TypeScript compiler node is deprecated and goes away in the next major. See ",[44,2992,2994],{"href":2993},"#printer-compiler-nodes","Printer compiler nodes",[1419,2996,2568],{"id":2997},"zod-encode-and-decode",[10,2999,3000,3002,3003,3006,3007,3010,3011,940,3014,3016,3017,3021],{},[48,3001,2563],{}," is ",[48,3004,3005],{},"'decode'"," for response schemas and ",[48,3008,3009],{},"'encode'"," for request bodies and parameters. Type the handlers as ",[48,3012,3013],{},"PrinterZodNodes",[48,3015,94],{}," to read it. ",[44,3018,3020],{"href":3019},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-zod\u002Fguides\u002Fcustomization#encode-custom-types","Encode custom types"," shows a direction-aware handler.",[115,3023,3025],{"id":3024},"less-common-cases","Less common cases",[1419,3027,2994],{"id":3028},"printer-compiler-nodes",[10,3030,3031,3032,3034,3035,3037,3038,3040],{},"A TypeScript printer handler that passes ",[48,3033,2541],{}," to ",[48,3036,2986],{}," breaks, because ",[48,3039,2541],{}," returns a string. Build the type as a string instead.",[106,3042,3043,3044,3046,3047,3050,3051,3054],{"as":910},"Returning a compiler node from ",[48,3045,241],{}," 5 or later, or ",[48,3048,3049],{},"@typescript\u002Ftypescript6",", still works with ",[48,3052,3053],{},"@kubb\u002Fparser-ts"," installed. It is deprecated and goes away in the next major.",{"title":911,"searchDepth":3056,"depth":3056,"links":3057},5,[3058,3060,3066,3070],{"id":117,"depth":3059,"text":118},2,{"id":66,"depth":3059,"text":933,"children":3061},[3062,3064,3065],{"id":1421,"depth":3063,"text":1422},3,{"id":1694,"depth":3063,"text":1695},{"id":2299,"depth":3063,"text":2300},{"id":2497,"depth":3059,"text":2498,"children":3067},[3068,3069],{"id":2977,"depth":3063,"text":2978},{"id":2997,"depth":3063,"text":2568},{"id":3024,"depth":3059,"text":3025,"children":3071},[3072],{"id":3028,"depth":3063,"text":2994},"Change what a Kubb plugin generates without forking it: rename symbols and files with a resolver, rewrite schemas with a macro, or swap a printer.","md",{"layout":3076,"title":5,"description":3073,"outline":3077,"order":3063,"navigation":3078},"doc",[3059,3063],{"title":5,"icon":3079},"i-iconoir-magic-wand",{"layout":3076,"outline":3081},[3059,3063],{"title":5,"icon":3079},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize",{"title":5,"description":3073},{"loc":3083},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize.md","docs\u002F5.x\u002Fhow-to\u002Fcustomize","Og4LfPXwOwQYSoHRnIVr_lhqxGAqt-mxjyHtKwE7mPQ",1794776426205]