[{"data":1,"prerenderedAt":333},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fschema-libraries":3,"i-lucide:moon":324,"i-lucide:github":329,"i-lucide:menu":331},{"id":4,"title":5,"body":6,"description":317,"extension":318,"meta":319,"navigation":78,"path":320,"seo":321,"stem":322,"__hash__":323},"docs\u002Fdocs\u002Fschema-libraries.md","Schema Libraries",{"type":7,"value":8,"toc":311},"minimark",[9,13,18,26,30,37,41,44,163,174,178,181,294,307],[10,11,12],"p",{},"Runtime parsing follows Standard Schema-style contracts where possible. OpenAPI conversion still depends on schema-library-specific adapters.",[14,15,17],"h2",{"id":16},"zod-v4","Zod v4",[10,19,20,21,25],{},"Zod schemas are converted through ",[22,23,24],"code",{},"@asteasolutions\u002Fzod-to-openapi",". Zod v4 is the target; Zod v3 is intentionally outside the compatibility surface.",[14,27,29],{"id":28},"valibot","Valibot",[10,31,32,33,36],{},"Valibot schemas are converted through ",[22,34,35],{},"@valibot\u002Fto-json-schema",". Request schemas use input mode, while response schemas use output mode.",[14,38,40],{"id":39},"effect-schema","Effect Schema",[10,42,43],{},"Effect Schema can be passed directly to endpoint definitions. Runtime parsing uses Effect's Standard Schema adapter, while OpenAPI conversion uses Effect's JSON Schema generator.",[45,46,51],"pre",{"className":47,"code":48,"language":49,"meta":50,"style":50},"language-ts shiki shiki-themes github-light-default github-dark-default","import { Schema } from 'effect'\n\ndefineEndpoint({\n  params: Schema.Struct({\n    id: Schema.NumberFromString,\n  }),\n  responses: {\n    200: Schema.Struct({\n      id: Schema.Number,\n      name: Schema.String,\n    }),\n  },\n})\n","ts","",[22,52,53,73,80,90,101,107,113,119,133,139,145,151,157],{"__ignoreMap":50},[54,55,58,62,66,69],"span",{"class":56,"line":57},"line",1,[54,59,61],{"class":60},"swxxe","import",[54,63,65],{"class":64},"saQ_J"," { Schema } ",[54,67,68],{"class":60},"from",[54,70,72],{"class":71},"sZItA"," 'effect'\n",[54,74,76],{"class":56,"line":75},2,[54,77,79],{"emptyLinePlaceholder":78},true,"\n",[54,81,83,87],{"class":56,"line":82},3,[54,84,86],{"class":85},"s9HWX","defineEndpoint",[54,88,89],{"class":64},"({\n",[54,91,93,96,99],{"class":56,"line":92},4,[54,94,95],{"class":64},"  params: Schema.",[54,97,98],{"class":85},"Struct",[54,100,89],{"class":64},[54,102,104],{"class":56,"line":103},5,[54,105,106],{"class":64},"    id: Schema.NumberFromString,\n",[54,108,110],{"class":56,"line":109},6,[54,111,112],{"class":64},"  }),\n",[54,114,116],{"class":56,"line":115},7,[54,117,118],{"class":64},"  responses: {\n",[54,120,122,126,129,131],{"class":56,"line":121},8,[54,123,125],{"class":124},"sOOdx","    200",[54,127,128],{"class":64},": Schema.",[54,130,98],{"class":85},[54,132,89],{"class":64},[54,134,136],{"class":56,"line":135},9,[54,137,138],{"class":64},"      id: Schema.Number,\n",[54,140,142],{"class":56,"line":141},10,[54,143,144],{"class":64},"      name: Schema.String,\n",[54,146,148],{"class":56,"line":147},11,[54,149,150],{"class":64},"    }),\n",[54,152,154],{"class":56,"line":153},12,[54,155,156],{"class":64},"  },\n",[54,158,160],{"class":56,"line":159},13,[54,161,162],{"class":64},"})\n",[10,164,165,166,169,170,173],{},"Effect schemas with runtime requirements are outside the supported contract surface. Use schemas whose ",[22,167,168],{},"Context"," is ",[22,171,172],{},"never",".",[14,175,177],{"id":176},"transforms-and-openapi-direction","Transforms and OpenAPI direction",[10,179,180],{},"For Valibot, request-side OpenAPI schemas use input mode and response-side schemas use output mode so transforms are represented in the right direction. Effect JSON Schema generation follows Effect's own JSON Schema rules.",[45,182,184],{"className":47,"code":183,"language":49,"meta":50,"style":50},"import * as v from 'valibot'\n\nconst Id = v.pipe(v.string(), v.transform(Number), v.number())\n\ndefineEndpoint({\n  body: v.object({ id: Id }), \u002F\u002F OpenAPI request schema: string\n  responses: { 200: v.object({ id: Id }) }, \u002F\u002F OpenAPI response schema: number\n})\n",[22,185,186,204,208,246,250,256,271,290],{"__ignoreMap":50},[54,187,188,190,193,196,199,201],{"class":56,"line":57},[54,189,61],{"class":60},[54,191,192],{"class":124}," *",[54,194,195],{"class":60}," as",[54,197,198],{"class":64}," v ",[54,200,68],{"class":60},[54,202,203],{"class":71}," 'valibot'\n",[54,205,206],{"class":56,"line":75},[54,207,79],{"emptyLinePlaceholder":78},[54,209,210,213,216,219,222,225,228,231,234,237,240,243],{"class":56,"line":82},[54,211,212],{"class":60},"const",[54,214,215],{"class":124}," Id",[54,217,218],{"class":60}," =",[54,220,221],{"class":64}," v.",[54,223,224],{"class":85},"pipe",[54,226,227],{"class":64},"(v.",[54,229,230],{"class":85},"string",[54,232,233],{"class":64},"(), v.",[54,235,236],{"class":85},"transform",[54,238,239],{"class":64},"(Number), v.",[54,241,242],{"class":85},"number",[54,244,245],{"class":64},"())\n",[54,247,248],{"class":56,"line":92},[54,249,79],{"emptyLinePlaceholder":78},[54,251,252,254],{"class":56,"line":103},[54,253,86],{"class":85},[54,255,89],{"class":64},[54,257,258,261,264,267],{"class":56,"line":109},[54,259,260],{"class":64},"  body: v.",[54,262,263],{"class":85},"object",[54,265,266],{"class":64},"({ id: Id }), ",[54,268,270],{"class":269},"sA0OV","\u002F\u002F OpenAPI request schema: string\n",[54,272,273,276,279,282,284,287],{"class":56,"line":115},[54,274,275],{"class":64},"  responses: { ",[54,277,278],{"class":124},"200",[54,280,281],{"class":64},": v.",[54,283,263],{"class":85},[54,285,286],{"class":64},"({ id: Id }) }, ",[54,288,289],{"class":269},"\u002F\u002F OpenAPI response schema: number\n",[54,291,292],{"class":56,"line":121},[54,293,162],{"class":64},[10,295,296,297,300,301,303,304,306],{},"Response validation uses the validator output on the server. Generated clients then apply the JSON wire mapping used by the supported Nitro line. A response output containing ",[22,298,299],{},"Date",", for example, is validated as ",[22,302,299],{}," but exposed to clients as ",[22,305,230],{},". Request inputs, server outputs, and client wire values are distinct boundaries.",[308,309,310],"style",{},"html pre.shiki code .swxxe, html code.shiki .swxxe{--shiki-light:#CF222E;--shiki-dark:#FF7B72}html pre.shiki code .saQ_J, html code.shiki .saQ_J{--shiki-light:#1F2328;--shiki-dark:#E6EDF3}html pre.shiki code .sZItA, html code.shiki .sZItA{--shiki-light:#0A3069;--shiki-dark:#A5D6FF}html pre.shiki code .s9HWX, html code.shiki .s9HWX{--shiki-light:#8250DF;--shiki-dark:#D2A8FF}html pre.shiki code .sOOdx, html code.shiki .sOOdx{--shiki-light:#0550AE;--shiki-dark:#79C0FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sA0OV, html code.shiki .sA0OV{--shiki-light:#6E7781;--shiki-dark:#8B949E}",{"title":50,"searchDepth":75,"depth":75,"links":312},[313,314,315,316],{"id":16,"depth":75,"text":17},{"id":28,"depth":75,"text":29},{"id":39,"depth":75,"text":40},{"id":176,"depth":75,"text":177},"Zod, Valibot, and Effect Schema are supported without locking the API layer to one vendor.","md",{},"\u002Fdocs\u002Fschema-libraries",{"title":5,"description":317},"docs\u002Fschema-libraries","GZNAJISDthZuwb1bB8OMLyhspPV2h7pZx8t9nOtu_rk",{"left":325,"top":325,"width":326,"height":326,"rotate":325,"vFlip":327,"hFlip":327,"body":328},0,24,false,"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\"\u002F>",{"left":325,"top":325,"width":326,"height":326,"rotate":325,"vFlip":327,"hFlip":327,"body":330,"hidden":78},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5c.08-1.25-.27-2.48-1-3.5c.28-1.15.28-2.35 0-3.5c0 0-1 0-3 1.5c-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.4 5.4 0 0 0 4 9c0 3.5 3 5.5 6 5.5c-.39.49-.68 1.05-.85 1.65S8.93 17.38 9 18v4\"\u002F>\u003Cpath d=\"M9 18c-4.51 2-5-2-7-2\"\u002F>\u003C\u002Fg>",{"left":325,"top":325,"width":326,"height":326,"rotate":325,"vFlip":327,"hFlip":327,"body":332},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 5h16M4 12h16M4 19h16\"\u002F>",1787723882332]