var d=Object.defineProperty;var l=(o)=>o;function m(o,a){this[o]=l.bind(null,a)}var f=(o,a)=>{for(var r in a)d(o,r,{get:a[r],enumerable:!0,configurable:!0,set:m.bind(a,r)})};var v=(o,a)=>()=>(o&&(a=o(o=0)),a);import u from"@contractspec/lib.ui-link";import{jsx as i,jsxs as g}from"react/jsx-runtime";function n({title:o="Need the operating layer on top of OSS ContractSpec?",body:a="ContractSpec Studio helps teams turn evidence into proposed spec changes, governed delivery loops, and execution-ready task packs while keeping the open contract system as the source of truth.",ctaLabel:r="See what Studio adds",href:p="https://www.contractspec.studio/docs"}){return g("div",{className:"card-subtle space-y-3 p-6",children:[i("h3",{className:"font-semibold text-lg",children:o}),i("p",{className:"text-muted-foreground text-sm",children:a}),i(u,{href:p,className:"btn-primary",children:r})]})}import{CodeBlock as c}from"@contractspec/lib.design-system";import s from"@contractspec/lib.ui-link";import{ChevronRight as h}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function E(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Generate docs + client schemas"}),e("p",{className:"text-lg text-muted-foreground",children:"Generate docs and OpenAPI output from ContractSpec operations to power SDKs, docs sites, and tooling."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"Export docs from your specs."}),e("li",{children:"Emit OpenAPI 3.1 for client SDK generation."}),e("li",{children:"Keep outputs deterministic with CI validation."})]})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Generate docs"}),e("p",{className:"text-muted-foreground text-sm",children:"Use the generator to emit docs from your contracts."}),e(c,{language:"bash",filename:"generate-docs",code:"contractspec generate"}),t("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",e("code",{children:"Generate X doc files in generated/docs"}),"."]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Export OpenAPI"}),e("p",{className:"text-muted-foreground text-sm",children:"Export an OpenAPI document from your registry module."}),e(c,{language:"bash",filename:"openapi-export",code:"contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json"}),t("p",{className:"text-muted-foreground text-sm",children:["Expected output:"," ",e("code",{children:"OpenAPI written to .../generated/openapi.json"}),"."]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Validate specs"}),e(c,{language:"bash",filename:"validate-specs",code:"contractspec validate"}),t("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",e("code",{children:"Validation passed"}),"."]})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Example package"}),e("p",{className:"text-muted-foreground text-sm",children:"The Integration Hub example provides a full registry of operations and is a good source for OpenAPI exports."}),e(c,{language:"bash",filename:"integration-hub-example",code:`contractspec examples show integration-hub

# openapi export against your registry module
contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json`})]}),e(n,{title:"Want exports tied to product decisions?",body:"Studio compiles approved changes into deliverables and pushes them to your execution stack with full evidence context."})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[t(s,{href:"/docs/guides/docs-generation-pipeline",className:"btn-primary",children:["Next: Docs pipeline ",e(h,{size:16})]}),e(s,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}export{E as GuideGenerateDocsClientsSchemasPage};
