[{"data":1,"prerenderedAt":3852},["ShallowReactive",2],{"search-sections-openapi":3,"nav-openapi":138,"content-tree-openapi":151,"footer-resources":157,"content-/v1.0.2/quickstart":2019,"surround-/v1.0.2/quickstart":3849},[4,10,14,20,26,31,36,41,46,51,54,59,64,69,74,79,84,89,93,98,103,108,113,118,123,128,133],{"id":5,"title":6,"titles":7,"content":8,"level":9},"/v1.0.2/overview","Overview",[],"Design philosophy and scope of the OpenAPI package",1,{"id":11,"title":6,"titles":12,"content":13,"level":9},"/v1.0.2/overview#overview",[],"The openapi package provides Go types that directly represent the OpenAPI 3.1 specification. Rather than wrapping the specification in builders or validation layers, this package treats the spec as data—struct fields map to spec fields, and standard marshalling handles serialization.",{"id":15,"title":16,"titles":17,"content":18,"level":19},"/v1.0.2/overview#design-philosophy","Design Philosophy",[6],"",2,{"id":21,"title":22,"titles":23,"content":24,"level":25},"/v1.0.2/overview#types-as-specification","Types as Specification",[6,16],"Every OpenAPI construct has a corresponding Go type. The OpenAPI struct contains Info, Paths, and Components fields because the specification defines those fields. Field names match the spec (with Go naming conventions), and struct tags handle the JSON/YAML field name mapping. This direct mapping means: Reading the OpenAPI 3.1 specification teaches you the packageNo translation layer between what you write and what gets serializedIDE autocompletion guides you through the spec structure",3,{"id":27,"title":28,"titles":29,"content":30,"level":25},"/v1.0.2/overview#zero-abstraction","Zero Abstraction",[6,16],"The package provides no builders, no fluent APIs, no validation methods. You construct specs using Go's native struct literal syntax: spec := &openapi.OpenAPI{\n    OpenAPI: \"3.1.0\",\n    Info: openapi.Info{Title: \"My API\", Version: \"1.0.0\"},\n} This is intentional. Abstractions would hide the specification's structure and create a learning curve separate from the spec itself. The spec is the API.",{"id":32,"title":33,"titles":34,"content":35,"level":25},"/v1.0.2/overview#minimal-dependencies","Minimal Dependencies",[6,16],"The package depends only on gopkg.in/yaml.v3 for YAML support. JSON marshalling uses the standard library. No validation libraries, no reflection utilities—just data structures.",{"id":37,"title":38,"titles":39,"content":40,"level":19},"/v1.0.2/overview#scope","Scope",[6],"This package handles: Type definitions: All OpenAPI 3.1 objects as Go structsSerialization: JSON and YAML marshalling/unmarshallingSchema types: The SchemaType helper for JSON Schema's type field (which can be a string or array) This package does not handle: Validation: Checking that a spec is semantically correctReference resolution: Dereferencing $ref pointersCode generation: Producing server/client code from specsHTTP routing: Matching requests to operations These concerns belong in separate packages that can depend on these types.",{"id":42,"title":43,"titles":44,"content":45,"level":19},"/v1.0.2/overview#versioning","Versioning",[6],"This package targets OpenAPI 3.1, which aligns with JSON Schema 2020-12. The key differences from OpenAPI 3.0: Schema type can be an array (e.g., [\"string\", \"null\"])nullable is replaced by including \"null\" in the type arrayWebhooks are a top-level constructJSON Schema keywords like const are available The SchemaType type handles the string-or-array complexity transparently. html pre.shiki code .sh8_p, html code.shiki .sh8_p{--shiki-default:var(--shiki-text)}html pre.shiki code .sW3Qg, html code.shiki .sW3Qg{--shiki-default:var(--shiki-operator)}html pre.shiki code .sYBwO, html code.shiki .sYBwO{--shiki-default:var(--shiki-type)}html pre.shiki code .sq5bi, html code.shiki .sq5bi{--shiki-default:var(--shiki-punctuation)}html pre.shiki code .sBGCq, html code.shiki .sBGCq{--shiki-default:var(--shiki-property)}html pre.shiki code .sxAnc, html code.shiki .sxAnc{--shiki-default:var(--shiki-string)}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"id":47,"title":48,"titles":49,"content":50,"level":9},"/v1.0.2/quickstart","Quick Start",[],"Common usage patterns for the OpenAPI package",{"id":52,"title":48,"titles":53,"content":18,"level":9},"/v1.0.2/quickstart#quick-start",[],{"id":55,"title":56,"titles":57,"content":58,"level":19},"/v1.0.2/quickstart#building-a-specification","Building a Specification",[48],"Construct specs using struct literals. Start with the root OpenAPI type and populate the fields you need: package main\n\nimport (\n    \"github.com/zoobz-io/openapi\"\n)\n\nfunc main() {\n    spec := &openapi.OpenAPI{\n        OpenAPI: \"3.1.0\",\n        Info: openapi.Info{\n            Title:       \"Bookstore API\",\n            Version:     \"1.0.0\",\n            Description: \"API for managing books\",\n        },\n        Servers: []openapi.Server{\n            {URL: \"https://api.bookstore.example.com\"},\n        },\n        Paths: map[string]openapi.PathItem{\n            \"/books\": {\n                Get: &openapi.Operation{\n                    Summary:     \"List books\",\n                    OperationID: \"listBooks\",\n                    Responses: map[string]openapi.Response{\n                        \"200\": {Description: \"Book list\"},\n                    },\n                },\n            },\n        },\n    }\n    _ = spec\n}",{"id":60,"title":61,"titles":62,"content":63,"level":19},"/v1.0.2/quickstart#reading-existing-specs","Reading Existing Specs",[48],"Parse JSON or YAML specs into Go types: // From JSON\ndata, _ := os.ReadFile(\"api.json\")\nspec, err := openapi.FromJSON(data)\nif err != nil {\n    log.Fatal(err)\n}\n\n// From YAML\ndata, _ := os.ReadFile(\"api.yaml\")\nspec, err := openapi.FromYAML(data)\nif err != nil {\n    log.Fatal(err)\n}\n\n// Access fields directly\nfmt.Println(spec.Info.Title)\nfor path, item := range spec.Paths {\n    if item.Get != nil {\n        fmt.Printf(\"GET %s: %s\\n\", path, item.Get.Summary)\n    }\n}",{"id":65,"title":66,"titles":67,"content":68,"level":19},"/v1.0.2/quickstart#writing-specs","Writing Specs",[48],"Serialize specs to JSON or YAML: // To JSON\njsonBytes, err := spec.ToJSON()\nos.WriteFile(\"api.json\", jsonBytes, 0644)\n\n// To YAML\nyamlBytes, err := spec.ToYAML()\nos.WriteFile(\"api.yaml\", yamlBytes, 0644)\n\n// Or use standard marshallers directly\njson.NewEncoder(os.Stdout).Encode(spec)\nyaml.NewEncoder(os.Stdout).Encode(spec)",{"id":70,"title":71,"titles":72,"content":73,"level":19},"/v1.0.2/quickstart#working-with-schemas","Working with Schemas",[48],"Schemas represent JSON Schema objects. Use NewSchemaType to set the type field: // Simple types\nstringSchema := &openapi.Schema{\n    Type: openapi.NewSchemaType(\"string\"),\n}\n\n// Nullable types (OpenAPI 3.1 style)\nnullableString := &openapi.Schema{\n    Type: openapi.NewSchemaTypes([]string{\"string\", \"null\"}),\n}\n\n// Object with properties\nuserSchema := &openapi.Schema{\n    Type: openapi.NewSchemaType(\"object\"),\n    Properties: map[string]*openapi.Schema{\n        \"id\":    {Type: openapi.NewSchemaType(\"integer\")},\n        \"email\": {Type: openapi.NewSchemaType(\"string\"), Format: \"email\"},\n    },\n    Required: []string{\"id\", \"email\"},\n}\n\n// Array of references\nusersSchema := &openapi.Schema{\n    Type:  openapi.NewSchemaType(\"array\"),\n    Items: &openapi.Schema{Ref: \"#/components/schemas/User\"},\n}",{"id":75,"title":76,"titles":77,"content":78,"level":19},"/v1.0.2/quickstart#using-references","Using References",[48],"Reference reusable components with the Ref field: spec := &openapi.OpenAPI{\n    // ... info, paths ...\n    Components: &openapi.Components{\n        Schemas: map[string]*openapi.Schema{\n            \"Error\": {\n                Type: openapi.NewSchemaType(\"object\"),\n                Properties: map[string]*openapi.Schema{\n                    \"code\":    {Type: openapi.NewSchemaType(\"integer\")},\n                    \"message\": {Type: openapi.NewSchemaType(\"string\")},\n                },\n            },\n        },\n        Responses: map[string]*openapi.Response{\n            \"NotFound\": {\n                Description: \"Resource not found\",\n                Content: map[string]openapi.MediaType{\n                    \"application/json\": {\n                        Schema: &openapi.Schema{Ref: \"#/components/schemas/Error\"},\n                    },\n                },\n            },\n        },\n    },\n}\n\n// Reference in an operation\noperation := &openapi.Operation{\n    Responses: map[string]openapi.Response{\n        \"404\": {Ref: \"#/components/responses/NotFound\"},\n    },\n}",{"id":80,"title":81,"titles":82,"content":83,"level":19},"/v1.0.2/quickstart#security-schemes","Security Schemes",[48],"Define authentication methods in components: spec.Components = &openapi.Components{\n    SecuritySchemes: map[string]*openapi.SecurityScheme{\n        \"bearerAuth\": {\n            Type:         \"http\",\n            Scheme:       \"bearer\",\n            BearerFormat: \"JWT\",\n        },\n        \"apiKey\": {\n            Type: \"apiKey\",\n            Name: \"X-API-Key\",\n            In:   \"header\",\n        },\n    },\n}\n\n// Apply globally\nspec.Security = []openapi.SecurityRequirement{\n    {\"bearerAuth\": {}},\n}\n\n// Or per-operation\noperation.Security = []openapi.SecurityRequirement{\n    {\"apiKey\": {}},\n} html pre.shiki code .sUt3r, html code.shiki .sUt3r{--shiki-default:var(--shiki-keyword)}html pre.shiki code .sYBwO, html code.shiki .sYBwO{--shiki-default:var(--shiki-type)}html pre.shiki code .soy-K, html code.shiki .soy-K{--shiki-default:#BBBBBB}html pre.shiki code .sxAnc, html code.shiki .sxAnc{--shiki-default:var(--shiki-string)}html pre.shiki code .s5klm, html code.shiki .s5klm{--shiki-default:var(--shiki-function)}html pre.shiki code .sq5bi, html code.shiki .sq5bi{--shiki-default:var(--shiki-punctuation)}html pre.shiki code .sh8_p, html code.shiki .sh8_p{--shiki-default:var(--shiki-text)}html pre.shiki code .sW3Qg, html code.shiki .sW3Qg{--shiki-default:var(--shiki-operator)}html pre.shiki code .sBGCq, html code.shiki .sBGCq{--shiki-default:var(--shiki-property)}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sLkEo, html code.shiki .sLkEo{--shiki-default:var(--shiki-comment)}html pre.shiki code .scyPU, html code.shiki .scyPU{--shiki-default:var(--shiki-placeholder)}html pre.shiki code .suWN2, html code.shiki .suWN2{--shiki-default:var(--shiki-tag)}html pre.shiki code .sMAmT, html code.shiki .sMAmT{--shiki-default:var(--shiki-number)}",{"id":85,"title":86,"titles":87,"content":88,"level":9},"/v1.0.2/types","Types",[],"Type hierarchy and relationships in the OpenAPI package",{"id":90,"title":86,"titles":91,"content":92,"level":9},"/v1.0.2/types#types",[],"This document outlines the type hierarchy. For complete field documentation, see pkg.go.dev.",{"id":94,"title":95,"titles":96,"content":97,"level":19},"/v1.0.2/types#root-object","Root Object",[86],"OpenAPI\n├── Info\n│   ├── Contact\n│   └── License\n├── Server[]\n│   └── ServerVariable (map)\n├── Paths (map)\n│   └── PathItem\n├── Webhooks (map)\n│   └── PathItem\n├── Components\n├── Security[]\n│   └── SecurityRequirement\n├── Tags[]\n│   └── Tag\n├── TagGroups[] (x-tagGroups)\n│   └── TagGroup\n└── ExternalDocumentation",{"id":99,"title":100,"titles":101,"content":102,"level":19},"/v1.0.2/types#path-and-operations","Path and Operations",[86],"PathItem\n├── Get, Post, Put, Delete, Patch, Options, Head → Operation\n├── Parameters[]\n├── Servers[]\n├── Ref (for $ref)\n├── Summary\n└── Description\n\nOperation\n├── OperationID\n├── Summary, Description\n├── Tags[]\n├── Parameters[]\n├── RequestBody\n├── Responses (map)\n├── Callbacks (map)\n├── Security[]\n├── Servers[]\n├── ExternalDocs\n└── Deprecated",{"id":104,"title":105,"titles":106,"content":107,"level":19},"/v1.0.2/types#request-and-response","Request and Response",[86],"RequestBody\n├── Content (map) → MediaType\n├── Description\n├── Required\n└── Ref\n\nResponse\n├── Description\n├── Headers (map) → Header\n├── Content (map) → MediaType\n├── Links (map) → Link\n└── Ref\n\nMediaType\n├── Schema\n├── Example\n├── Examples (map) → Example\n└── Encoding (map)",{"id":109,"title":110,"titles":111,"content":112,"level":19},"/v1.0.2/types#schema","Schema",[86],"The Schema type represents JSON Schema with OpenAPI extensions: Schema\n├── Type → SchemaType\n├── Format\n├── Properties (map) → Schema\n├── Items → Schema\n├── Required[]\n├── AllOf[], OneOf[], AnyOf[] → Schema\n├── Not → Schema\n├── Discriminator\n├── Ref\n├── Title, Description\n├── Default, Const, Example\n├── Enum[]\n├── Minimum, Maximum, ExclusiveMinimum, ExclusiveMaximum\n├── MinLength, MaxLength\n├── Pattern\n├── MinItems, MaxItems, UniqueItems\n├── MinProperties, MaxProperties\n├── AdditionalProperties\n├── ReadOnly, WriteOnly, Deprecated\n├── XML\n└── ExternalDocs",{"id":114,"title":115,"titles":116,"content":117,"level":19},"/v1.0.2/types#schematype","SchemaType",[86],"Handles the JSON Schema type field, which can be a string or array: // Single type\nType: openapi.NewSchemaType(\"string\")\n\n// Multiple types (nullable)\nType: openapi.NewSchemaTypes([]string{\"string\", \"null\"})\n\n// Query methods\nschemaType.IsEmpty()     // True if no type set\nschemaType.IsArray()     // True if multiple types\nschemaType.IsNullable()  // True if contains \"null\"\nschemaType.Contains(\"string\")\nschemaType.String()      // First/only type as string\nschemaType.Strings()     // All types as slice",{"id":119,"title":120,"titles":121,"content":122,"level":19},"/v1.0.2/types#components","Components",[86],"Reusable objects referenced via $ref: Components\n├── Schemas (map) → Schema\n├── Responses (map) → Response\n├── Parameters (map) → Parameter\n├── Examples (map) → Example\n├── RequestBodies (map) → RequestBody\n├── Headers (map) → Header\n├── SecuritySchemes (map) → SecurityScheme\n├── Links (map) → Link\n├── Callbacks (map) → Callback\n└── PathItems (map) → PathItem",{"id":124,"title":125,"titles":126,"content":127,"level":19},"/v1.0.2/types#security","Security",[86],"SecurityScheme\n├── Type (\"apiKey\", \"http\", \"oauth2\", \"openIdConnect\")\n├── Description\n├── Name, In (for apiKey)\n├── Scheme, BearerFormat (for http)\n├── Flows → OAuthFlows (for oauth2)\n└── OpenIDConnectURL (for openIdConnect)\n\nOAuthFlows\n├── Implicit → OAuthFlow\n├── Password → OAuthFlow\n├── ClientCredentials → OAuthFlow\n└── AuthorizationCode → OAuthFlow\n\nOAuthFlow\n├── AuthorizationURL\n├── TokenURL\n├── RefreshURL\n└── Scopes (map)\n\nSecurityRequirement = map[string][]string",{"id":129,"title":130,"titles":131,"content":132,"level":19},"/v1.0.2/types#supporting-types","Supporting Types",[86],"Parameter\n├── Name, In, Description\n├── Required, Deprecated\n├── Schema or Content\n├── Style, Explode\n├── Example, Examples\n└── Ref\n\nHeader\n├── (Same fields as Parameter, minus Name and In)\n└── Ref\n\nLink\n├── OperationRef or OperationID\n├── Parameters (map)\n├── RequestBody\n├── Description\n├── Server\n└── Ref\n\nCallback = map[string]PathItem\n\nTag\n├── Name\n├── Description\n└── ExternalDocs\n\nTagGroup (x-tagGroups vendor extension)\n├── Name\n└── Tags[]\n\nExternalDocumentation\n├── URL\n└── Description\n\nDiscriminator\n├── PropertyName\n└── Mapping (map)\n\nXML\n├── Name, Namespace, Prefix\n├── Attribute\n└── Wrapped\n\nEncoding\n├── ContentType\n├── Headers (map)\n├── Style, Explode\n└── AllowReserved\n\nExample\n├── Summary, Description\n├── Value or ExternalValue\n└── Ref",{"id":134,"title":135,"titles":136,"content":137,"level":19},"/v1.0.2/types#reference-pattern","Reference Pattern",[86],"Most types support $ref via a Ref field. When Ref is set, other fields should be empty: // Inline definition\nschema := &openapi.Schema{\n    Type: openapi.NewSchemaType(\"object\"),\n    Properties: map[string]*openapi.Schema{...},\n}\n\n// Reference\nschema := &openapi.Schema{\n    Ref: \"#/components/schemas/User\",\n} Reference resolution is not handled by this package—that's a concern for tooling built on top of these types. html pre.shiki code .sLkEo, html code.shiki .sLkEo{--shiki-default:var(--shiki-comment)}html pre.shiki code .sBGCq, html code.shiki .sBGCq{--shiki-default:var(--shiki-property)}html pre.shiki code .sq5bi, html code.shiki .sq5bi{--shiki-default:var(--shiki-punctuation)}html pre.shiki code .sh8_p, html code.shiki .sh8_p{--shiki-default:var(--shiki-text)}html pre.shiki code .s5klm, html code.shiki .s5klm{--shiki-default:var(--shiki-function)}html pre.shiki code .sxAnc, html code.shiki .sxAnc{--shiki-default:var(--shiki-string)}html pre.shiki code .sYBwO, html code.shiki .sYBwO{--shiki-default:var(--shiki-type)}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sW3Qg, html code.shiki .sW3Qg{--shiki-default:var(--shiki-operator)}html pre.shiki code .sUt3r, html code.shiki .sUt3r{--shiki-default:var(--shiki-keyword)}",[139],{"title":140,"path":141,"stem":142,"children":143,"page":150},"V102","/v1.0.2","v1.0.2",[144,146,148],{"title":6,"path":5,"stem":145,"description":8},"v1.0.2/1.overview",{"title":48,"path":47,"stem":147,"description":50},"v1.0.2/2.quickstart",{"title":86,"path":85,"stem":149,"description":88},"v1.0.2/3.types",false,[152],{"title":140,"path":141,"stem":142,"children":153,"page":150},[154,155,156],{"title":6,"path":5,"stem":145},{"title":48,"path":47,"stem":147},{"title":86,"path":85,"stem":149},[158,1575,1742],{"id":159,"title":160,"body":161,"description":18,"extension":1568,"icon":1569,"meta":1570,"navigation":653,"path":1571,"seo":1572,"stem":1573,"__hash__":1574},"resources/readme.md","README",{"type":162,"value":163,"toc":1559},"minimark",[164,169,237,240,245,248,606,609,613,630,633,636,1474,1478,1513,1517,1537,1541,1549,1552,1555],[165,166,168],"h1",{"id":167},"openapi","OpenAPI",[170,171,172,183,191,199,207,215,222,229],"p",{},[173,174,178],"a",{"href":175,"rel":176},"https://github.com/zoobz-io/openapi/actions/workflows/ci.yml",[177],"nofollow",[179,180],"img",{"alt":181,"src":182},"CI Status","https://github.com/zoobz-io/openapi/workflows/CI/badge.svg",[173,184,187],{"href":185,"rel":186},"https://codecov.io/gh/zoobz-io/openapi",[177],[179,188],{"alt":189,"src":190},"codecov","https://codecov.io/gh/zoobz-io/openapi/graph/badge.svg?branch=main",[173,192,195],{"href":193,"rel":194},"https://goreportcard.com/report/github.com/zoobz-io/openapi",[177],[179,196],{"alt":197,"src":198},"Go Report Card","https://goreportcard.com/badge/github.com/zoobz-io/openapi",[173,200,203],{"href":201,"rel":202},"https://github.com/zoobz-io/openapi/security/code-scanning",[177],[179,204],{"alt":205,"src":206},"CodeQL","https://github.com/zoobz-io/openapi/workflows/CodeQL/badge.svg",[173,208,211],{"href":209,"rel":210},"https://pkg.go.dev/github.com/zoobz-io/openapi",[177],[179,212],{"alt":213,"src":214},"Go Reference","https://pkg.go.dev/badge/github.com/zoobz-io/openapi.svg",[173,216,218],{"href":217},"LICENSE",[179,219],{"alt":220,"src":221},"License","https://img.shields.io/github/license/zoobz-io/openapi",[173,223,225],{"href":224},"go.mod",[179,226],{"alt":227,"src":228},"Go Version","https://img.shields.io/github/go-mod/go-version/zoobz-io/openapi",[173,230,233],{"href":231,"rel":232},"https://github.com/zoobz-io/openapi/releases",[177],[179,234],{"alt":235,"src":236},"Release","https://img.shields.io/github/v/release/zoobz-io/openapi",[170,238,239],{},"OpenAPI 3.1 as native Go types. Build, read, and write API specifications with full type safety.",[241,242,244],"h2",{"id":243},"openapi-in-go","OpenAPI in Go",[170,246,247],{},"The OpenAPI specification becomes Go structs—each type mirrors the spec exactly:",[249,250,254],"pre",{"className":251,"code":252,"language":253,"meta":18,"style":18},"language-go shiki shiki-themes","spec := &openapi.OpenAPI{\n    OpenAPI: \"3.1.0\",\n    Info: openapi.Info{\n        Title:   \"Users API\",\n        Version: \"1.0.0\",\n    },\n    Paths: map[string]openapi.PathItem{\n        \"/users/{id}\": {\n            Get: &openapi.Operation{\n                OperationID: \"getUser\",\n                Parameters: []openapi.Parameter{{\n                    Name:     \"id\",\n                    In:       \"path\",\n                    Required: true,\n                    Schema:   &openapi.Schema{Type: openapi.NewSchemaType(\"string\")},\n                }},\n                Responses: map[string]openapi.Response{\n                    \"200\": {Description: \"User found\"},\n                },\n            },\n        },\n    },\n}\n","go",[255,256,257,284,300,317,330,343,349,379,390,409,422,443,456,469,482,524,530,555,577,583,589,595,600],"code",{"__ignoreMap":18},[258,259,261,265,268,272,275,279,281],"span",{"class":260,"line":9},"line",[258,262,264],{"class":263},"sh8_p","spec",[258,266,267],{"class":263}," :=",[258,269,271],{"class":270},"sW3Qg"," &",[258,273,167],{"class":274},"sYBwO",[258,276,278],{"class":277},"sq5bi",".",[258,280,168],{"class":274},[258,282,283],{"class":277},"{\n",[258,285,286,290,293,297],{"class":260,"line":19},[258,287,289],{"class":288},"sBGCq","    OpenAPI",[258,291,292],{"class":277},":",[258,294,296],{"class":295},"sxAnc"," \"3.1.0\"",[258,298,299],{"class":277},",\n",[258,301,302,305,307,310,312,315],{"class":260,"line":25},[258,303,304],{"class":288},"    Info",[258,306,292],{"class":277},[258,308,309],{"class":274}," openapi",[258,311,278],{"class":277},[258,313,314],{"class":274},"Info",[258,316,283],{"class":277},[258,318,320,323,325,328],{"class":260,"line":319},4,[258,321,322],{"class":288},"        Title",[258,324,292],{"class":277},[258,326,327],{"class":295},"   \"Users API\"",[258,329,299],{"class":277},[258,331,333,336,338,341],{"class":260,"line":332},5,[258,334,335],{"class":288},"        Version",[258,337,292],{"class":277},[258,339,340],{"class":295}," \"1.0.0\"",[258,342,299],{"class":277},[258,344,346],{"class":260,"line":345},6,[258,347,348],{"class":277},"    },\n",[258,350,352,355,357,361,364,367,370,372,374,377],{"class":260,"line":351},7,[258,353,354],{"class":288},"    Paths",[258,356,292],{"class":277},[258,358,360],{"class":359},"sUt3r"," map",[258,362,363],{"class":277},"[",[258,365,366],{"class":274},"string",[258,368,369],{"class":277},"]",[258,371,167],{"class":274},[258,373,278],{"class":277},[258,375,376],{"class":274},"PathItem",[258,378,283],{"class":277},[258,380,382,385,387],{"class":260,"line":381},8,[258,383,384],{"class":295},"        \"/users/{id}\"",[258,386,292],{"class":277},[258,388,389],{"class":277}," {\n",[258,391,393,396,398,400,402,404,407],{"class":260,"line":392},9,[258,394,395],{"class":288},"            Get",[258,397,292],{"class":277},[258,399,271],{"class":270},[258,401,167],{"class":274},[258,403,278],{"class":277},[258,405,406],{"class":274},"Operation",[258,408,283],{"class":277},[258,410,412,415,417,420],{"class":260,"line":411},10,[258,413,414],{"class":288},"                OperationID",[258,416,292],{"class":277},[258,418,419],{"class":295}," \"getUser\"",[258,421,299],{"class":277},[258,423,425,428,430,433,435,437,440],{"class":260,"line":424},11,[258,426,427],{"class":288},"                Parameters",[258,429,292],{"class":277},[258,431,432],{"class":277}," []",[258,434,167],{"class":274},[258,436,278],{"class":277},[258,438,439],{"class":274},"Parameter",[258,441,442],{"class":277},"{{\n",[258,444,446,449,451,454],{"class":260,"line":445},12,[258,447,448],{"class":288},"                    Name",[258,450,292],{"class":277},[258,452,453],{"class":295},"     \"id\"",[258,455,299],{"class":277},[258,457,459,462,464,467],{"class":260,"line":458},13,[258,460,461],{"class":288},"                    In",[258,463,292],{"class":277},[258,465,466],{"class":295},"       \"path\"",[258,468,299],{"class":277},[258,470,472,475,477,480],{"class":260,"line":471},14,[258,473,474],{"class":288},"                    Required",[258,476,292],{"class":277},[258,478,479],{"class":359}," true",[258,481,299],{"class":277},[258,483,485,488,490,493,495,497,499,502,505,507,509,511,515,518,521],{"class":260,"line":484},15,[258,486,487],{"class":288},"                    Schema",[258,489,292],{"class":277},[258,491,492],{"class":270},"   &",[258,494,167],{"class":274},[258,496,278],{"class":277},[258,498,110],{"class":274},[258,500,501],{"class":277},"{",[258,503,504],{"class":288},"Type",[258,506,292],{"class":277},[258,508,309],{"class":263},[258,510,278],{"class":277},[258,512,514],{"class":513},"s5klm","NewSchemaType",[258,516,517],{"class":277},"(",[258,519,520],{"class":295},"\"string\"",[258,522,523],{"class":277},")},\n",[258,525,527],{"class":260,"line":526},16,[258,528,529],{"class":277},"                }},\n",[258,531,533,536,538,540,542,544,546,548,550,553],{"class":260,"line":532},17,[258,534,535],{"class":288},"                Responses",[258,537,292],{"class":277},[258,539,360],{"class":359},[258,541,363],{"class":277},[258,543,366],{"class":274},[258,545,369],{"class":277},[258,547,167],{"class":274},[258,549,278],{"class":277},[258,551,552],{"class":274},"Response",[258,554,283],{"class":277},[258,556,558,561,563,566,569,571,574],{"class":260,"line":557},18,[258,559,560],{"class":295},"                    \"200\"",[258,562,292],{"class":277},[258,564,565],{"class":277}," {",[258,567,568],{"class":288},"Description",[258,570,292],{"class":277},[258,572,573],{"class":295}," \"User found\"",[258,575,576],{"class":277},"},\n",[258,578,580],{"class":260,"line":579},19,[258,581,582],{"class":277},"                },\n",[258,584,586],{"class":260,"line":585},20,[258,587,588],{"class":277},"            },\n",[258,590,592],{"class":260,"line":591},21,[258,593,594],{"class":277},"        },\n",[258,596,598],{"class":260,"line":597},22,[258,599,348],{"class":277},[258,601,603],{"class":260,"line":602},23,[258,604,605],{"class":277},"}\n",[170,607,608],{},"No wrapper functions. No builder patterns. Just the specification as data.",[241,610,612],{"id":611},"install","Install",[249,614,618],{"className":615,"code":616,"language":617,"meta":18,"style":18},"language-bash shiki shiki-themes","go get github.com/zoobz-io/openapi\n","bash",[255,619,620],{"__ignoreMap":18},[258,621,622,624,627],{"class":260,"line":9},[258,623,253],{"class":513},[258,625,626],{"class":295}," get",[258,628,629],{"class":295}," github.com/zoobz-io/openapi\n",[170,631,632],{},"Requires Go 1.24 or higher.",[241,634,48],{"id":635},"quick-start",[249,637,639],{"className":251,"code":638,"language":253,"meta":18,"style":18},"package main\n\nimport (\n    \"encoding/json\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com/zoobz-io/openapi\"\n    \"gopkg.in/yaml.v3\"\n)\n\nfunc main() {\n    // Build a specification\n    spec := &openapi.OpenAPI{\n        OpenAPI: \"3.1.0\",\n        Info: openapi.Info{\n            Title:       \"Pet Store\",\n            Version:     \"1.0.0\",\n            Description: \"A sample pet store API\",\n        },\n        Paths: map[string]openapi.PathItem{\n            \"/pets\": {\n                Get: &openapi.Operation{\n                    Summary:     \"List all pets\",\n                    OperationID: \"listPets\",\n                    Responses: map[string]openapi.Response{\n                        \"200\": {\n                            Description: \"A list of pets\",\n                            Content: map[string]openapi.MediaType{\n                                \"application/json\": {\n                                    Schema: &openapi.Schema{\n                                        Type:  openapi.NewSchemaType(\"array\"),\n                                        Items: &openapi.Schema{Ref: \"#/components/schemas/Pet\"},\n                                    },\n                                },\n                            },\n                        },\n                    },\n                },\n            },\n        },\n        Components: &openapi.Components{\n            Schemas: map[string]*openapi.Schema{\n                \"Pet\": {\n                    Type: openapi.NewSchemaType(\"object\"),\n                    Properties: map[string]*openapi.Schema{\n                        \"id\":   {Type: openapi.NewSchemaType(\"integer\")},\n                        \"name\": {Type: openapi.NewSchemaType(\"string\")},\n                    },\n                    Required: []string{\"id\", \"name\"},\n                },\n            },\n        },\n    }\n\n    // Output as JSON\n    json.NewEncoder(os.Stdout).Encode(spec)\n\n    // Or YAML\n    yaml.NewEncoder(os.Stdout).Encode(spec)\n\n    // Read existing specs\n    data, _ := os.ReadFile(\"api.yaml\")\n    var existing openapi.OpenAPI\n    yaml.Unmarshal(data, &existing)\n    fmt.Println(existing.Info.Title)\n}\n",[255,640,641,649,655,664,669,674,679,683,688,693,698,702,715,721,738,749,764,776,788,800,804,827,836,853,866,879,903,913,926,951,961,979,1002,1030,1036,1042,1048,1054,1060,1065,1070,1075,1093,1120,1130,1151,1177,1205,1231,1236,1260,1265,1270,1275,1281,1286,1292,1325,1330,1336,1364,1369,1375,1403,1419,1443,1469],{"__ignoreMap":18},[258,642,643,646],{"class":260,"line":9},[258,644,645],{"class":359},"package",[258,647,648],{"class":274}," main\n",[258,650,651],{"class":260,"line":19},[258,652,654],{"emptyLinePlaceholder":653},true,"\n",[258,656,657,660],{"class":260,"line":25},[258,658,659],{"class":359},"import",[258,661,663],{"class":662},"soy-K"," (\n",[258,665,666],{"class":260,"line":319},[258,667,668],{"class":295},"    \"encoding/json\"\n",[258,670,671],{"class":260,"line":332},[258,672,673],{"class":295},"    \"fmt\"\n",[258,675,676],{"class":260,"line":345},[258,677,678],{"class":295},"    \"os\"\n",[258,680,681],{"class":260,"line":351},[258,682,654],{"emptyLinePlaceholder":653},[258,684,685],{"class":260,"line":381},[258,686,687],{"class":295},"    \"github.com/zoobz-io/openapi\"\n",[258,689,690],{"class":260,"line":392},[258,691,692],{"class":295},"    \"gopkg.in/yaml.v3\"\n",[258,694,695],{"class":260,"line":411},[258,696,697],{"class":662},")\n",[258,699,700],{"class":260,"line":424},[258,701,654],{"emptyLinePlaceholder":653},[258,703,704,707,710,713],{"class":260,"line":445},[258,705,706],{"class":359},"func",[258,708,709],{"class":513}," main",[258,711,712],{"class":277},"()",[258,714,389],{"class":277},[258,716,717],{"class":260,"line":458},[258,718,720],{"class":719},"sLkEo","    // Build a specification\n",[258,722,723,726,728,730,732,734,736],{"class":260,"line":471},[258,724,725],{"class":263},"    spec",[258,727,267],{"class":263},[258,729,271],{"class":270},[258,731,167],{"class":274},[258,733,278],{"class":277},[258,735,168],{"class":274},[258,737,283],{"class":277},[258,739,740,743,745,747],{"class":260,"line":484},[258,741,742],{"class":288},"        OpenAPI",[258,744,292],{"class":277},[258,746,296],{"class":295},[258,748,299],{"class":277},[258,750,751,754,756,758,760,762],{"class":260,"line":526},[258,752,753],{"class":288},"        Info",[258,755,292],{"class":277},[258,757,309],{"class":274},[258,759,278],{"class":277},[258,761,314],{"class":274},[258,763,283],{"class":277},[258,765,766,769,771,774],{"class":260,"line":532},[258,767,768],{"class":288},"            Title",[258,770,292],{"class":277},[258,772,773],{"class":295},"       \"Pet Store\"",[258,775,299],{"class":277},[258,777,778,781,783,786],{"class":260,"line":557},[258,779,780],{"class":288},"            Version",[258,782,292],{"class":277},[258,784,785],{"class":295},"     \"1.0.0\"",[258,787,299],{"class":277},[258,789,790,793,795,798],{"class":260,"line":579},[258,791,792],{"class":288},"            Description",[258,794,292],{"class":277},[258,796,797],{"class":295}," \"A sample pet store API\"",[258,799,299],{"class":277},[258,801,802],{"class":260,"line":585},[258,803,594],{"class":277},[258,805,806,809,811,813,815,817,819,821,823,825],{"class":260,"line":591},[258,807,808],{"class":288},"        Paths",[258,810,292],{"class":277},[258,812,360],{"class":359},[258,814,363],{"class":277},[258,816,366],{"class":274},[258,818,369],{"class":277},[258,820,167],{"class":274},[258,822,278],{"class":277},[258,824,376],{"class":274},[258,826,283],{"class":277},[258,828,829,832,834],{"class":260,"line":597},[258,830,831],{"class":295},"            \"/pets\"",[258,833,292],{"class":277},[258,835,389],{"class":277},[258,837,838,841,843,845,847,849,851],{"class":260,"line":602},[258,839,840],{"class":288},"                Get",[258,842,292],{"class":277},[258,844,271],{"class":270},[258,846,167],{"class":274},[258,848,278],{"class":277},[258,850,406],{"class":274},[258,852,283],{"class":277},[258,854,856,859,861,864],{"class":260,"line":855},24,[258,857,858],{"class":288},"                    Summary",[258,860,292],{"class":277},[258,862,863],{"class":295},"     \"List all pets\"",[258,865,299],{"class":277},[258,867,869,872,874,877],{"class":260,"line":868},25,[258,870,871],{"class":288},"                    OperationID",[258,873,292],{"class":277},[258,875,876],{"class":295}," \"listPets\"",[258,878,299],{"class":277},[258,880,882,885,887,889,891,893,895,897,899,901],{"class":260,"line":881},26,[258,883,884],{"class":288},"                    Responses",[258,886,292],{"class":277},[258,888,360],{"class":359},[258,890,363],{"class":277},[258,892,366],{"class":274},[258,894,369],{"class":277},[258,896,167],{"class":274},[258,898,278],{"class":277},[258,900,552],{"class":274},[258,902,283],{"class":277},[258,904,906,909,911],{"class":260,"line":905},27,[258,907,908],{"class":295},"                        \"200\"",[258,910,292],{"class":277},[258,912,389],{"class":277},[258,914,916,919,921,924],{"class":260,"line":915},28,[258,917,918],{"class":288},"                            Description",[258,920,292],{"class":277},[258,922,923],{"class":295}," \"A list of pets\"",[258,925,299],{"class":277},[258,927,929,932,934,936,938,940,942,944,946,949],{"class":260,"line":928},29,[258,930,931],{"class":288},"                            Content",[258,933,292],{"class":277},[258,935,360],{"class":359},[258,937,363],{"class":277},[258,939,366],{"class":274},[258,941,369],{"class":277},[258,943,167],{"class":274},[258,945,278],{"class":277},[258,947,948],{"class":274},"MediaType",[258,950,283],{"class":277},[258,952,954,957,959],{"class":260,"line":953},30,[258,955,956],{"class":295},"                                \"application/json\"",[258,958,292],{"class":277},[258,960,389],{"class":277},[258,962,964,967,969,971,973,975,977],{"class":260,"line":963},31,[258,965,966],{"class":288},"                                    Schema",[258,968,292],{"class":277},[258,970,271],{"class":270},[258,972,167],{"class":274},[258,974,278],{"class":277},[258,976,110],{"class":274},[258,978,283],{"class":277},[258,980,982,985,987,990,992,994,996,999],{"class":260,"line":981},32,[258,983,984],{"class":288},"                                        Type",[258,986,292],{"class":277},[258,988,989],{"class":263},"  openapi",[258,991,278],{"class":277},[258,993,514],{"class":513},[258,995,517],{"class":277},[258,997,998],{"class":295},"\"array\"",[258,1000,1001],{"class":277},"),\n",[258,1003,1005,1008,1010,1012,1014,1016,1018,1020,1023,1025,1028],{"class":260,"line":1004},33,[258,1006,1007],{"class":288},"                                        Items",[258,1009,292],{"class":277},[258,1011,271],{"class":270},[258,1013,167],{"class":274},[258,1015,278],{"class":277},[258,1017,110],{"class":274},[258,1019,501],{"class":277},[258,1021,1022],{"class":288},"Ref",[258,1024,292],{"class":277},[258,1026,1027],{"class":295}," \"#/components/schemas/Pet\"",[258,1029,576],{"class":277},[258,1031,1033],{"class":260,"line":1032},34,[258,1034,1035],{"class":277},"                                    },\n",[258,1037,1039],{"class":260,"line":1038},35,[258,1040,1041],{"class":277},"                                },\n",[258,1043,1045],{"class":260,"line":1044},36,[258,1046,1047],{"class":277},"                            },\n",[258,1049,1051],{"class":260,"line":1050},37,[258,1052,1053],{"class":277},"                        },\n",[258,1055,1057],{"class":260,"line":1056},38,[258,1058,1059],{"class":277},"                    },\n",[258,1061,1063],{"class":260,"line":1062},39,[258,1064,582],{"class":277},[258,1066,1068],{"class":260,"line":1067},40,[258,1069,588],{"class":277},[258,1071,1073],{"class":260,"line":1072},41,[258,1074,594],{"class":277},[258,1076,1078,1081,1083,1085,1087,1089,1091],{"class":260,"line":1077},42,[258,1079,1080],{"class":288},"        Components",[258,1082,292],{"class":277},[258,1084,271],{"class":270},[258,1086,167],{"class":274},[258,1088,278],{"class":277},[258,1090,120],{"class":274},[258,1092,283],{"class":277},[258,1094,1096,1099,1101,1103,1105,1107,1109,1112,1114,1116,1118],{"class":260,"line":1095},43,[258,1097,1098],{"class":288},"            Schemas",[258,1100,292],{"class":277},[258,1102,360],{"class":359},[258,1104,363],{"class":277},[258,1106,366],{"class":274},[258,1108,369],{"class":277},[258,1110,1111],{"class":270},"*",[258,1113,167],{"class":274},[258,1115,278],{"class":277},[258,1117,110],{"class":274},[258,1119,283],{"class":277},[258,1121,1123,1126,1128],{"class":260,"line":1122},44,[258,1124,1125],{"class":295},"                \"Pet\"",[258,1127,292],{"class":277},[258,1129,389],{"class":277},[258,1131,1133,1136,1138,1140,1142,1144,1146,1149],{"class":260,"line":1132},45,[258,1134,1135],{"class":288},"                    Type",[258,1137,292],{"class":277},[258,1139,309],{"class":263},[258,1141,278],{"class":277},[258,1143,514],{"class":513},[258,1145,517],{"class":277},[258,1147,1148],{"class":295},"\"object\"",[258,1150,1001],{"class":277},[258,1152,1154,1157,1159,1161,1163,1165,1167,1169,1171,1173,1175],{"class":260,"line":1153},46,[258,1155,1156],{"class":288},"                    Properties",[258,1158,292],{"class":277},[258,1160,360],{"class":359},[258,1162,363],{"class":277},[258,1164,366],{"class":274},[258,1166,369],{"class":277},[258,1168,1111],{"class":270},[258,1170,167],{"class":274},[258,1172,278],{"class":277},[258,1174,110],{"class":274},[258,1176,283],{"class":277},[258,1178,1180,1183,1185,1188,1190,1192,1194,1196,1198,1200,1203],{"class":260,"line":1179},47,[258,1181,1182],{"class":295},"                        \"id\"",[258,1184,292],{"class":277},[258,1186,1187],{"class":277},"   {",[258,1189,504],{"class":288},[258,1191,292],{"class":277},[258,1193,309],{"class":263},[258,1195,278],{"class":277},[258,1197,514],{"class":513},[258,1199,517],{"class":277},[258,1201,1202],{"class":295},"\"integer\"",[258,1204,523],{"class":277},[258,1206,1208,1211,1213,1215,1217,1219,1221,1223,1225,1227,1229],{"class":260,"line":1207},48,[258,1209,1210],{"class":295},"                        \"name\"",[258,1212,292],{"class":277},[258,1214,565],{"class":277},[258,1216,504],{"class":288},[258,1218,292],{"class":277},[258,1220,309],{"class":263},[258,1222,278],{"class":277},[258,1224,514],{"class":513},[258,1226,517],{"class":277},[258,1228,520],{"class":295},[258,1230,523],{"class":277},[258,1232,1234],{"class":260,"line":1233},49,[258,1235,1059],{"class":277},[258,1237,1239,1241,1243,1245,1247,1249,1252,1255,1258],{"class":260,"line":1238},50,[258,1240,474],{"class":288},[258,1242,292],{"class":277},[258,1244,432],{"class":277},[258,1246,366],{"class":274},[258,1248,501],{"class":277},[258,1250,1251],{"class":295},"\"id\"",[258,1253,1254],{"class":277},",",[258,1256,1257],{"class":295}," \"name\"",[258,1259,576],{"class":277},[258,1261,1263],{"class":260,"line":1262},51,[258,1264,582],{"class":277},[258,1266,1268],{"class":260,"line":1267},52,[258,1269,588],{"class":277},[258,1271,1273],{"class":260,"line":1272},53,[258,1274,594],{"class":277},[258,1276,1278],{"class":260,"line":1277},54,[258,1279,1280],{"class":277},"    }\n",[258,1282,1284],{"class":260,"line":1283},55,[258,1285,654],{"emptyLinePlaceholder":653},[258,1287,1289],{"class":260,"line":1288},56,[258,1290,1291],{"class":719},"    // Output as JSON\n",[258,1293,1295,1298,1300,1303,1305,1308,1310,1313,1316,1319,1321,1323],{"class":260,"line":1294},57,[258,1296,1297],{"class":263},"    json",[258,1299,278],{"class":277},[258,1301,1302],{"class":513},"NewEncoder",[258,1304,517],{"class":277},[258,1306,1307],{"class":263},"os",[258,1309,278],{"class":277},[258,1311,1312],{"class":263},"Stdout",[258,1314,1315],{"class":277},").",[258,1317,1318],{"class":513},"Encode",[258,1320,517],{"class":277},[258,1322,264],{"class":263},[258,1324,697],{"class":277},[258,1326,1328],{"class":260,"line":1327},58,[258,1329,654],{"emptyLinePlaceholder":653},[258,1331,1333],{"class":260,"line":1332},59,[258,1334,1335],{"class":719},"    // Or YAML\n",[258,1337,1339,1342,1344,1346,1348,1350,1352,1354,1356,1358,1360,1362],{"class":260,"line":1338},60,[258,1340,1341],{"class":263},"    yaml",[258,1343,278],{"class":277},[258,1345,1302],{"class":513},[258,1347,517],{"class":277},[258,1349,1307],{"class":263},[258,1351,278],{"class":277},[258,1353,1312],{"class":263},[258,1355,1315],{"class":277},[258,1357,1318],{"class":513},[258,1359,517],{"class":277},[258,1361,264],{"class":263},[258,1363,697],{"class":277},[258,1365,1367],{"class":260,"line":1366},61,[258,1368,654],{"emptyLinePlaceholder":653},[258,1370,1372],{"class":260,"line":1371},62,[258,1373,1374],{"class":719},"    // Read existing specs\n",[258,1376,1378,1381,1383,1386,1388,1391,1393,1396,1398,1401],{"class":260,"line":1377},63,[258,1379,1380],{"class":263},"    data",[258,1382,1254],{"class":277},[258,1384,1385],{"class":263}," _",[258,1387,267],{"class":263},[258,1389,1390],{"class":263}," os",[258,1392,278],{"class":277},[258,1394,1395],{"class":513},"ReadFile",[258,1397,517],{"class":277},[258,1399,1400],{"class":295},"\"api.yaml\"",[258,1402,697],{"class":277},[258,1404,1406,1409,1412,1414,1416],{"class":260,"line":1405},64,[258,1407,1408],{"class":359},"    var",[258,1410,1411],{"class":263}," existing",[258,1413,309],{"class":274},[258,1415,278],{"class":277},[258,1417,1418],{"class":274},"OpenAPI\n",[258,1420,1422,1424,1426,1429,1431,1434,1436,1438,1441],{"class":260,"line":1421},65,[258,1423,1341],{"class":263},[258,1425,278],{"class":277},[258,1427,1428],{"class":513},"Unmarshal",[258,1430,517],{"class":277},[258,1432,1433],{"class":263},"data",[258,1435,1254],{"class":277},[258,1437,271],{"class":270},[258,1439,1440],{"class":263},"existing",[258,1442,697],{"class":277},[258,1444,1446,1449,1451,1454,1456,1458,1460,1462,1464,1467],{"class":260,"line":1445},66,[258,1447,1448],{"class":263},"    fmt",[258,1450,278],{"class":277},[258,1452,1453],{"class":513},"Println",[258,1455,517],{"class":277},[258,1457,1440],{"class":263},[258,1459,278],{"class":277},[258,1461,314],{"class":263},[258,1463,278],{"class":277},[258,1465,1466],{"class":263},"Title",[258,1468,697],{"class":277},[258,1470,1472],{"class":260,"line":1471},67,[258,1473,605],{"class":277},[241,1475,1477],{"id":1476},"why-openapi","Why OpenAPI?",[1479,1480,1481,1489,1495,1501,1507],"ul",{},[1482,1483,1484,1488],"li",{},[1485,1486,1487],"strong",{},"Direct mapping",": Types match the OpenAPI 3.1 specification exactly—no translation layer",[1482,1490,1491,1494],{},[1485,1492,1493],{},"Full coverage",": Every spec construct supported, from basic paths to discriminators and callbacks",[1482,1496,1497,1500],{},[1485,1498,1499],{},"Dual format",": JSON and YAML serialization work identically via struct tags",[1482,1502,1503,1506],{},[1485,1504,1505],{},"Zero magic",": Standard Go marshalling, no reflection tricks or code generation",[1482,1508,1509,1512],{},[1485,1510,1511],{},"Minimal footprint",": Single dependency (yaml.v3), pure data structures",[241,1514,1516],{"id":1515},"documentation","Documentation",[1479,1518,1519,1525,1531],{},[1482,1520,1521,1524],{},[173,1522,6],{"href":1523},"docs/overview"," — Design philosophy and scope",[1482,1526,1527,1530],{},[173,1528,48],{"href":1529},"docs/quickstart"," — Common usage patterns",[1482,1532,1533,1536],{},[173,1534,86],{"href":1535},"docs/types"," — Type hierarchy and relationships",[241,1538,1540],{"id":1539},"contributing","Contributing",[170,1542,1543,1544,1548],{},"Contributions welcome. See ",[173,1545,1547],{"href":1546},"CONTRIBUTING","CONTRIBUTING.md"," for guidelines.",[241,1550,220],{"id":1551},"license",[170,1553,1554],{},"MIT",[1556,1557,1558],"style",{},"html pre.shiki code .sh8_p, html code.shiki .sh8_p{--shiki-default:var(--shiki-text)}html pre.shiki code .sW3Qg, html code.shiki .sW3Qg{--shiki-default:var(--shiki-operator)}html pre.shiki code .sYBwO, html code.shiki .sYBwO{--shiki-default:var(--shiki-type)}html pre.shiki code .sq5bi, html code.shiki .sq5bi{--shiki-default:var(--shiki-punctuation)}html pre.shiki code .sBGCq, html code.shiki .sBGCq{--shiki-default:var(--shiki-property)}html pre.shiki code .sxAnc, html code.shiki .sxAnc{--shiki-default:var(--shiki-string)}html pre.shiki code .sUt3r, html code.shiki .sUt3r{--shiki-default:var(--shiki-keyword)}html pre.shiki code .s5klm, html code.shiki .s5klm{--shiki-default:var(--shiki-function)}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .soy-K, html code.shiki .soy-K{--shiki-default:#BBBBBB}html pre.shiki code .sLkEo, html code.shiki .sLkEo{--shiki-default:var(--shiki-comment)}",{"title":18,"searchDepth":19,"depth":19,"links":1560},[1561,1562,1563,1564,1565,1566,1567],{"id":243,"depth":19,"text":244},{"id":611,"depth":19,"text":612},{"id":635,"depth":19,"text":48},{"id":1476,"depth":19,"text":1477},{"id":1515,"depth":19,"text":1516},{"id":1539,"depth":19,"text":1540},{"id":1551,"depth":19,"text":220},"md","book-open",{},"/readme",{"title":160,"description":18},"readme","pzVpIJZ4Jz76rnrKhXXQVblOpoC_wPWk3RER9eBDURA",{"id":1576,"title":125,"body":1577,"description":18,"extension":1568,"icon":1736,"meta":1737,"navigation":653,"path":1738,"seo":1739,"stem":1740,"__hash__":1741},"resources/security.md",{"type":162,"value":1578,"toc":1729},[1579,1583,1587,1615,1619,1622,1651,1655,1658,1698,1702,1705,1722,1726],[165,1580,1582],{"id":1581},"security-policy","Security Policy",[241,1584,1586],{"id":1585},"supported-versions","Supported Versions",[1588,1589,1590,1603],"table",{},[1591,1592,1593],"thead",{},[1594,1595,1596,1600],"tr",{},[1597,1598,1599],"th",{},"Version",[1597,1601,1602],{},"Supported",[1604,1605,1606],"tbody",{},[1594,1607,1608,1612],{},[1609,1610,1611],"td",{},"Latest",[1609,1613,1614],{},"✅",[241,1616,1618],{"id":1617},"reporting-a-vulnerability","Reporting a Vulnerability",[170,1620,1621],{},"We take security vulnerabilities seriously. If you discover a security issue, please follow these steps:",[1623,1624,1625,1631,1634],"ol",{},[1482,1626,1627,1630],{},[1485,1628,1629],{},"DO NOT"," create a public GitHub issue",[1482,1632,1633],{},"Email security details to the maintainers",[1482,1635,1636,1637],{},"Include:\n",[1479,1638,1639,1642,1645,1648],{},[1482,1640,1641],{},"Description of the vulnerability",[1482,1643,1644],{},"Steps to reproduce",[1482,1646,1647],{},"Potential impact",[1482,1649,1650],{},"Suggested fix (if available)",[241,1652,1654],{"id":1653},"security-best-practices","Security Best Practices",[170,1656,1657],{},"When using OpenAPI:",[1623,1659,1660,1666,1672,1682,1688],{},[1482,1661,1662,1665],{},[1485,1663,1664],{},"Input Validation",": When unmarshaling untrusted data, validate the resulting structures before use.",[1482,1667,1668,1671],{},[1485,1669,1670],{},"Schema Definitions",": Be cautious when programmatically generating schemas from user input, as this could lead to injection attacks.",[1482,1673,1674,1677,1678,1681],{},[1485,1675,1676],{},"Reference Resolution",": If implementing ",[255,1679,1680],{},"$ref"," resolution, ensure proper bounds checking to prevent infinite loops or resource exhaustion.",[1482,1683,1684,1687],{},[1485,1685,1686],{},"Example Data",": Example values in schemas may be rendered in documentation. Ensure they don't contain sensitive information.",[1482,1689,1690,1693,1694,1697],{},[1485,1691,1692],{},"External URLs",": When processing ",[255,1695,1696],{},"url"," fields (servers, external docs, etc.), validate them to prevent SSRF attacks.",[241,1699,1701],{"id":1700},"security-features","Security Features",[170,1703,1704],{},"OpenAPI is designed with security in mind:",[1479,1706,1707,1710,1713,1716,1719],{},[1482,1708,1709],{},"Minimal dependencies (only gopkg.in/yaml.v3)",[1482,1711,1712],{},"No network operations",[1482,1714,1715],{},"No file system operations beyond normal Go imports",[1482,1717,1718],{},"Pure data structures with no executable code",[1482,1720,1721],{},"Thread-safe for concurrent use",[241,1723,1725],{"id":1724},"acknowledgments","Acknowledgments",[170,1727,1728],{},"We appreciate responsible disclosure of security vulnerabilities.",{"title":18,"searchDepth":19,"depth":19,"links":1730},[1731,1732,1733,1734,1735],{"id":1585,"depth":19,"text":1586},{"id":1617,"depth":19,"text":1618},{"id":1653,"depth":19,"text":1654},{"id":1700,"depth":19,"text":1701},{"id":1724,"depth":19,"text":1725},"shield",{},"/security",{"title":125,"description":18},"security","p3s51WMXpl0TzlrUtk8Hpb8lHJy8MmXOW-fd8Q03jVU",{"id":1743,"title":1540,"body":1744,"description":1752,"extension":1568,"icon":255,"meta":2015,"navigation":653,"path":2016,"seo":2017,"stem":1539,"__hash__":2018},"resources/contributing.md",{"type":162,"value":1745,"toc":2003},[1746,1750,1753,1757,1795,1799,1804,1816,1820,1876,1880,1900,1904,1921,1925,1942,1946,1949,1993,1997,2000],[165,1747,1749],{"id":1748},"contributing-to-openapi","Contributing to OpenAPI",[170,1751,1752],{},"Thank you for your interest in contributing to OpenAPI! We welcome contributions from the community.",[241,1754,1756],{"id":1755},"getting-started","Getting Started",[1623,1758,1759,1762,1768,1774,1777,1783,1789,1792],{},[1482,1760,1761],{},"Fork the repository",[1482,1763,1764,1765],{},"Clone your fork: ",[255,1766,1767],{},"git clone https://github.com/your-username/openapi.git",[1482,1769,1770,1771],{},"Create a new branch: ",[255,1772,1773],{},"git checkout -b feature/your-feature-name",[1482,1775,1776],{},"Make your changes",[1482,1778,1779,1780],{},"Run tests: ",[255,1781,1782],{},"make test",[1482,1784,1785,1786],{},"Run linters: ",[255,1787,1788],{},"make lint",[1482,1790,1791],{},"Commit your changes with a descriptive message",[1482,1793,1794],{},"Push to your fork and submit a pull request",[241,1796,1798],{"id":1797},"development-setup","Development Setup",[1800,1801,1803],"h3",{"id":1802},"prerequisites","Prerequisites",[1479,1805,1806,1809],{},[1482,1807,1808],{},"Go 1.24 or higher",[1482,1810,1811,1812,1815],{},"golangci-lint (install with ",[255,1813,1814],{},"make install-tools",")",[1800,1817,1819],{"id":1818},"running-tests","Running Tests",[249,1821,1823],{"className":615,"code":1822,"language":617,"meta":18,"style":18},"make test        # Run all tests\nmake bench       # Run benchmarks\nmake coverage    # Generate coverage report\nmake lint        # Run linters\nmake check       # Run tests and lint\n",[255,1824,1825,1836,1846,1856,1866],{"__ignoreMap":18},[258,1826,1827,1830,1833],{"class":260,"line":9},[258,1828,1829],{"class":513},"make",[258,1831,1832],{"class":295}," test",[258,1834,1835],{"class":719},"        # Run all tests\n",[258,1837,1838,1840,1843],{"class":260,"line":19},[258,1839,1829],{"class":513},[258,1841,1842],{"class":295}," bench",[258,1844,1845],{"class":719},"       # Run benchmarks\n",[258,1847,1848,1850,1853],{"class":260,"line":25},[258,1849,1829],{"class":513},[258,1851,1852],{"class":295}," coverage",[258,1854,1855],{"class":719},"    # Generate coverage report\n",[258,1857,1858,1860,1863],{"class":260,"line":319},[258,1859,1829],{"class":513},[258,1861,1862],{"class":295}," lint",[258,1864,1865],{"class":719},"        # Run linters\n",[258,1867,1868,1870,1873],{"class":260,"line":332},[258,1869,1829],{"class":513},[258,1871,1872],{"class":295}," check",[258,1874,1875],{"class":719},"       # Run tests and lint\n",[241,1877,1879],{"id":1878},"code-style","Code Style",[1479,1881,1882,1885,1891,1894,1897],{},[1482,1883,1884],{},"Follow standard Go conventions",[1482,1886,1887,1888],{},"Ensure all code passes ",[255,1889,1890],{},"golangci-lint",[1482,1892,1893],{},"Write tests for new functionality",[1482,1895,1896],{},"Document exported functions and types",[1482,1898,1899],{},"Maintain struct tag correctness for JSON and YAML",[241,1901,1903],{"id":1902},"pull-request-process","Pull Request Process",[1623,1905,1906,1909,1912,1915,1918],{},[1482,1907,1908],{},"Ensure all tests pass",[1482,1910,1911],{},"Update documentation if needed",[1482,1913,1914],{},"Add entries to CHANGELOG.md if applicable",[1482,1916,1917],{},"Ensure your PR description clearly describes the problem and solution",[1482,1919,1920],{},"Link any relevant issues",[241,1922,1924],{"id":1923},"testing-guidelines","Testing Guidelines",[1479,1926,1927,1930,1933,1936,1939],{},[1482,1928,1929],{},"Each source file should have a corresponding test file",[1482,1931,1932],{},"Write both positive and negative test cases",[1482,1934,1935],{},"Use table-driven tests where appropriate",[1482,1937,1938],{},"Ensure tests are deterministic and don't depend on external services",[1482,1940,1941],{},"Test both JSON and YAML serialization when adding new types",[241,1943,1945],{"id":1944},"commit-message-format","Commit Message Format",[170,1947,1948],{},"Use conventional commits format:",[1479,1950,1951,1957,1963,1969,1975,1981,1987],{},[1482,1952,1953,1956],{},[255,1954,1955],{},"feat:"," New feature",[1482,1958,1959,1962],{},[255,1960,1961],{},"fix:"," Bug fix",[1482,1964,1965,1968],{},[255,1966,1967],{},"docs:"," Documentation changes",[1482,1970,1971,1974],{},[255,1972,1973],{},"test:"," Test additions or changes",[1482,1976,1977,1980],{},[255,1978,1979],{},"refactor:"," Code refactoring",[1482,1982,1983,1986],{},[255,1984,1985],{},"perf:"," Performance improvements",[1482,1988,1989,1992],{},[255,1990,1991],{},"chore:"," Maintenance tasks",[241,1994,1996],{"id":1995},"questions","Questions?",[170,1998,1999],{},"Feel free to open an issue for any questions or concerns.",[1556,2001,2002],{},"html pre.shiki code .s5klm, html code.shiki .s5klm{--shiki-default:var(--shiki-function)}html pre.shiki code .sxAnc, html code.shiki .sxAnc{--shiki-default:var(--shiki-string)}html pre.shiki code .sLkEo, html code.shiki .sLkEo{--shiki-default:var(--shiki-comment)}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":18,"searchDepth":19,"depth":19,"links":2004},[2005,2006,2010,2011,2012,2013,2014],{"id":1755,"depth":19,"text":1756},{"id":1797,"depth":19,"text":1798,"children":2007},[2008,2009],{"id":1802,"depth":25,"text":1803},{"id":1818,"depth":25,"text":1819},{"id":1878,"depth":19,"text":1879},{"id":1902,"depth":19,"text":1903},{"id":1923,"depth":19,"text":1924},{"id":1944,"depth":19,"text":1945},{"id":1995,"depth":19,"text":1996},{},"/contributing",{"title":1540,"description":1752},"gCEb0z64S44hvBcGroxq5ZEvZ74VIy2XMNJ3HpYLlDw",{"id":2020,"title":48,"author":2021,"body":2022,"description":50,"extension":1568,"meta":3842,"navigation":653,"path":47,"published":3843,"readtime":3844,"seo":3845,"stem":147,"tags":3846,"updated":3843,"__hash__":3848},"openapi/v1.0.2/2.quickstart.md","zoobzio",{"type":162,"value":2023,"toc":3834},[2024,2026,2029,2035,2334,2337,2340,2653,2656,2659,2831,2834,2840,3184,3187,3193,3579,3582,3585,3831],[165,2025,48],{"id":635},[241,2027,56],{"id":2028},"building-a-specification",[170,2030,2031,2032,2034],{},"Construct specs using struct literals. Start with the root ",[255,2033,168],{}," type and populate the fields you need:",[249,2036,2038],{"className":251,"code":2037,"language":253,"meta":18,"style":18},"package main\n\nimport (\n    \"github.com/zoobz-io/openapi\"\n)\n\nfunc main() {\n    spec := &openapi.OpenAPI{\n        OpenAPI: \"3.1.0\",\n        Info: openapi.Info{\n            Title:       \"Bookstore API\",\n            Version:     \"1.0.0\",\n            Description: \"API for managing books\",\n        },\n        Servers: []openapi.Server{\n            {URL: \"https://api.bookstore.example.com\"},\n        },\n        Paths: map[string]openapi.PathItem{\n            \"/books\": {\n                Get: &openapi.Operation{\n                    Summary:     \"List books\",\n                    OperationID: \"listBooks\",\n                    Responses: map[string]openapi.Response{\n                        \"200\": {Description: \"Book list\"},\n                    },\n                },\n            },\n        },\n    }\n    _ = spec\n}\n",[255,2039,2040,2046,2050,2056,2060,2064,2068,2078,2094,2104,2118,2129,2139,2150,2154,2172,2187,2191,2213,2222,2238,2249,2260,2282,2299,2303,2307,2311,2315,2319,2330],{"__ignoreMap":18},[258,2041,2042,2044],{"class":260,"line":9},[258,2043,645],{"class":359},[258,2045,648],{"class":274},[258,2047,2048],{"class":260,"line":19},[258,2049,654],{"emptyLinePlaceholder":653},[258,2051,2052,2054],{"class":260,"line":25},[258,2053,659],{"class":359},[258,2055,663],{"class":662},[258,2057,2058],{"class":260,"line":319},[258,2059,687],{"class":295},[258,2061,2062],{"class":260,"line":332},[258,2063,697],{"class":662},[258,2065,2066],{"class":260,"line":345},[258,2067,654],{"emptyLinePlaceholder":653},[258,2069,2070,2072,2074,2076],{"class":260,"line":351},[258,2071,706],{"class":359},[258,2073,709],{"class":513},[258,2075,712],{"class":277},[258,2077,389],{"class":277},[258,2079,2080,2082,2084,2086,2088,2090,2092],{"class":260,"line":381},[258,2081,725],{"class":263},[258,2083,267],{"class":263},[258,2085,271],{"class":270},[258,2087,167],{"class":274},[258,2089,278],{"class":277},[258,2091,168],{"class":274},[258,2093,283],{"class":277},[258,2095,2096,2098,2100,2102],{"class":260,"line":392},[258,2097,742],{"class":288},[258,2099,292],{"class":277},[258,2101,296],{"class":295},[258,2103,299],{"class":277},[258,2105,2106,2108,2110,2112,2114,2116],{"class":260,"line":411},[258,2107,753],{"class":288},[258,2109,292],{"class":277},[258,2111,309],{"class":274},[258,2113,278],{"class":277},[258,2115,314],{"class":274},[258,2117,283],{"class":277},[258,2119,2120,2122,2124,2127],{"class":260,"line":424},[258,2121,768],{"class":288},[258,2123,292],{"class":277},[258,2125,2126],{"class":295},"       \"Bookstore API\"",[258,2128,299],{"class":277},[258,2130,2131,2133,2135,2137],{"class":260,"line":445},[258,2132,780],{"class":288},[258,2134,292],{"class":277},[258,2136,785],{"class":295},[258,2138,299],{"class":277},[258,2140,2141,2143,2145,2148],{"class":260,"line":458},[258,2142,792],{"class":288},[258,2144,292],{"class":277},[258,2146,2147],{"class":295}," \"API for managing books\"",[258,2149,299],{"class":277},[258,2151,2152],{"class":260,"line":471},[258,2153,594],{"class":277},[258,2155,2156,2159,2161,2163,2165,2167,2170],{"class":260,"line":484},[258,2157,2158],{"class":288},"        Servers",[258,2160,292],{"class":277},[258,2162,432],{"class":277},[258,2164,167],{"class":274},[258,2166,278],{"class":277},[258,2168,2169],{"class":274},"Server",[258,2171,283],{"class":277},[258,2173,2174,2177,2180,2182,2185],{"class":260,"line":526},[258,2175,2176],{"class":277},"            {",[258,2178,2179],{"class":288},"URL",[258,2181,292],{"class":277},[258,2183,2184],{"class":295}," \"https://api.bookstore.example.com\"",[258,2186,576],{"class":277},[258,2188,2189],{"class":260,"line":532},[258,2190,594],{"class":277},[258,2192,2193,2195,2197,2199,2201,2203,2205,2207,2209,2211],{"class":260,"line":557},[258,2194,808],{"class":288},[258,2196,292],{"class":277},[258,2198,360],{"class":359},[258,2200,363],{"class":277},[258,2202,366],{"class":274},[258,2204,369],{"class":277},[258,2206,167],{"class":274},[258,2208,278],{"class":277},[258,2210,376],{"class":274},[258,2212,283],{"class":277},[258,2214,2215,2218,2220],{"class":260,"line":579},[258,2216,2217],{"class":295},"            \"/books\"",[258,2219,292],{"class":277},[258,2221,389],{"class":277},[258,2223,2224,2226,2228,2230,2232,2234,2236],{"class":260,"line":585},[258,2225,840],{"class":288},[258,2227,292],{"class":277},[258,2229,271],{"class":270},[258,2231,167],{"class":274},[258,2233,278],{"class":277},[258,2235,406],{"class":274},[258,2237,283],{"class":277},[258,2239,2240,2242,2244,2247],{"class":260,"line":591},[258,2241,858],{"class":288},[258,2243,292],{"class":277},[258,2245,2246],{"class":295},"     \"List books\"",[258,2248,299],{"class":277},[258,2250,2251,2253,2255,2258],{"class":260,"line":597},[258,2252,871],{"class":288},[258,2254,292],{"class":277},[258,2256,2257],{"class":295}," \"listBooks\"",[258,2259,299],{"class":277},[258,2261,2262,2264,2266,2268,2270,2272,2274,2276,2278,2280],{"class":260,"line":602},[258,2263,884],{"class":288},[258,2265,292],{"class":277},[258,2267,360],{"class":359},[258,2269,363],{"class":277},[258,2271,366],{"class":274},[258,2273,369],{"class":277},[258,2275,167],{"class":274},[258,2277,278],{"class":277},[258,2279,552],{"class":274},[258,2281,283],{"class":277},[258,2283,2284,2286,2288,2290,2292,2294,2297],{"class":260,"line":855},[258,2285,908],{"class":295},[258,2287,292],{"class":277},[258,2289,565],{"class":277},[258,2291,568],{"class":288},[258,2293,292],{"class":277},[258,2295,2296],{"class":295}," \"Book list\"",[258,2298,576],{"class":277},[258,2300,2301],{"class":260,"line":868},[258,2302,1059],{"class":277},[258,2304,2305],{"class":260,"line":881},[258,2306,582],{"class":277},[258,2308,2309],{"class":260,"line":905},[258,2310,588],{"class":277},[258,2312,2313],{"class":260,"line":915},[258,2314,594],{"class":277},[258,2316,2317],{"class":260,"line":928},[258,2318,1280],{"class":277},[258,2320,2321,2324,2327],{"class":260,"line":953},[258,2322,2323],{"class":263},"    _",[258,2325,2326],{"class":263}," =",[258,2328,2329],{"class":263}," spec\n",[258,2331,2332],{"class":260,"line":963},[258,2333,605],{"class":277},[241,2335,61],{"id":2336},"reading-existing-specs",[170,2338,2339],{},"Parse JSON or YAML specs into Go types:",[249,2341,2343],{"className":251,"code":2342,"language":253,"meta":18,"style":18},"// From JSON\ndata, _ := os.ReadFile(\"api.json\")\nspec, err := openapi.FromJSON(data)\nif err != nil {\n    log.Fatal(err)\n}\n\n// From YAML\ndata, _ := os.ReadFile(\"api.yaml\")\nspec, err := openapi.FromYAML(data)\nif err != nil {\n    log.Fatal(err)\n}\n\n// Access fields directly\nfmt.Println(spec.Info.Title)\nfor path, item := range spec.Paths {\n    if item.Get != nil {\n        fmt.Printf(\"GET %s: %s\\n\", path, item.Get.Summary)\n    }\n}\n",[255,2344,2345,2350,2373,2397,2412,2429,2433,2437,2442,2464,2487,2499,2513,2517,2521,2526,2549,2577,2595,2645,2649],{"__ignoreMap":18},[258,2346,2347],{"class":260,"line":9},[258,2348,2349],{"class":719},"// From JSON\n",[258,2351,2352,2354,2356,2358,2360,2362,2364,2366,2368,2371],{"class":260,"line":19},[258,2353,1433],{"class":263},[258,2355,1254],{"class":277},[258,2357,1385],{"class":263},[258,2359,267],{"class":263},[258,2361,1390],{"class":263},[258,2363,278],{"class":277},[258,2365,1395],{"class":513},[258,2367,517],{"class":277},[258,2369,2370],{"class":295},"\"api.json\"",[258,2372,697],{"class":277},[258,2374,2375,2377,2379,2382,2384,2386,2388,2391,2393,2395],{"class":260,"line":25},[258,2376,264],{"class":263},[258,2378,1254],{"class":277},[258,2380,2381],{"class":263}," err",[258,2383,267],{"class":263},[258,2385,309],{"class":263},[258,2387,278],{"class":277},[258,2389,2390],{"class":513},"FromJSON",[258,2392,517],{"class":277},[258,2394,1433],{"class":263},[258,2396,697],{"class":277},[258,2398,2399,2402,2404,2407,2410],{"class":260,"line":319},[258,2400,2401],{"class":270},"if",[258,2403,2381],{"class":263},[258,2405,2406],{"class":270}," !=",[258,2408,2409],{"class":359}," nil",[258,2411,389],{"class":277},[258,2413,2414,2417,2419,2422,2424,2427],{"class":260,"line":332},[258,2415,2416],{"class":263},"    log",[258,2418,278],{"class":277},[258,2420,2421],{"class":513},"Fatal",[258,2423,517],{"class":277},[258,2425,2426],{"class":263},"err",[258,2428,697],{"class":277},[258,2430,2431],{"class":260,"line":345},[258,2432,605],{"class":277},[258,2434,2435],{"class":260,"line":351},[258,2436,654],{"emptyLinePlaceholder":653},[258,2438,2439],{"class":260,"line":381},[258,2440,2441],{"class":719},"// From YAML\n",[258,2443,2444,2446,2448,2450,2452,2454,2456,2458,2460,2462],{"class":260,"line":392},[258,2445,1433],{"class":263},[258,2447,1254],{"class":277},[258,2449,1385],{"class":263},[258,2451,267],{"class":263},[258,2453,1390],{"class":263},[258,2455,278],{"class":277},[258,2457,1395],{"class":513},[258,2459,517],{"class":277},[258,2461,1400],{"class":295},[258,2463,697],{"class":277},[258,2465,2466,2468,2470,2472,2474,2476,2478,2481,2483,2485],{"class":260,"line":411},[258,2467,264],{"class":263},[258,2469,1254],{"class":277},[258,2471,2381],{"class":263},[258,2473,267],{"class":263},[258,2475,309],{"class":263},[258,2477,278],{"class":277},[258,2479,2480],{"class":513},"FromYAML",[258,2482,517],{"class":277},[258,2484,1433],{"class":263},[258,2486,697],{"class":277},[258,2488,2489,2491,2493,2495,2497],{"class":260,"line":424},[258,2490,2401],{"class":270},[258,2492,2381],{"class":263},[258,2494,2406],{"class":270},[258,2496,2409],{"class":359},[258,2498,389],{"class":277},[258,2500,2501,2503,2505,2507,2509,2511],{"class":260,"line":445},[258,2502,2416],{"class":263},[258,2504,278],{"class":277},[258,2506,2421],{"class":513},[258,2508,517],{"class":277},[258,2510,2426],{"class":263},[258,2512,697],{"class":277},[258,2514,2515],{"class":260,"line":458},[258,2516,605],{"class":277},[258,2518,2519],{"class":260,"line":471},[258,2520,654],{"emptyLinePlaceholder":653},[258,2522,2523],{"class":260,"line":484},[258,2524,2525],{"class":719},"// Access fields directly\n",[258,2527,2528,2531,2533,2535,2537,2539,2541,2543,2545,2547],{"class":260,"line":526},[258,2529,2530],{"class":263},"fmt",[258,2532,278],{"class":277},[258,2534,1453],{"class":513},[258,2536,517],{"class":277},[258,2538,264],{"class":263},[258,2540,278],{"class":277},[258,2542,314],{"class":263},[258,2544,278],{"class":277},[258,2546,1466],{"class":263},[258,2548,697],{"class":277},[258,2550,2551,2554,2557,2559,2562,2564,2567,2570,2572,2575],{"class":260,"line":532},[258,2552,2553],{"class":270},"for",[258,2555,2556],{"class":263}," path",[258,2558,1254],{"class":277},[258,2560,2561],{"class":263}," item",[258,2563,267],{"class":263},[258,2565,2566],{"class":270}," range",[258,2568,2569],{"class":263}," spec",[258,2571,278],{"class":277},[258,2573,2574],{"class":263},"Paths",[258,2576,389],{"class":277},[258,2578,2579,2582,2584,2586,2589,2591,2593],{"class":260,"line":557},[258,2580,2581],{"class":270},"    if",[258,2583,2561],{"class":263},[258,2585,278],{"class":277},[258,2587,2588],{"class":263},"Get",[258,2590,2406],{"class":270},[258,2592,2409],{"class":359},[258,2594,389],{"class":277},[258,2596,2597,2600,2602,2605,2607,2610,2614,2617,2619,2623,2626,2628,2630,2632,2634,2636,2638,2640,2643],{"class":260,"line":579},[258,2598,2599],{"class":263},"        fmt",[258,2601,278],{"class":277},[258,2603,2604],{"class":513},"Printf",[258,2606,517],{"class":277},[258,2608,2609],{"class":295},"\"GET ",[258,2611,2613],{"class":2612},"scyPU","%s",[258,2615,2616],{"class":295},": ",[258,2618,2613],{"class":2612},[258,2620,2622],{"class":2621},"suWN2","\\n",[258,2624,2625],{"class":295},"\"",[258,2627,1254],{"class":277},[258,2629,2556],{"class":263},[258,2631,1254],{"class":277},[258,2633,2561],{"class":263},[258,2635,278],{"class":277},[258,2637,2588],{"class":263},[258,2639,278],{"class":277},[258,2641,2642],{"class":263},"Summary",[258,2644,697],{"class":277},[258,2646,2647],{"class":260,"line":585},[258,2648,1280],{"class":277},[258,2650,2651],{"class":260,"line":591},[258,2652,605],{"class":277},[241,2654,66],{"id":2655},"writing-specs",[170,2657,2658],{},"Serialize specs to JSON or YAML:",[249,2660,2662],{"className":251,"code":2661,"language":253,"meta":18,"style":18},"// To JSON\njsonBytes, err := spec.ToJSON()\nos.WriteFile(\"api.json\", jsonBytes, 0644)\n\n// To YAML\nyamlBytes, err := spec.ToYAML()\nos.WriteFile(\"api.yaml\", yamlBytes, 0644)\n\n// Or use standard marshallers directly\njson.NewEncoder(os.Stdout).Encode(spec)\nyaml.NewEncoder(os.Stdout).Encode(spec)\n",[255,2663,2664,2669,2690,2716,2720,2725,2745,2768,2772,2777,2804],{"__ignoreMap":18},[258,2665,2666],{"class":260,"line":9},[258,2667,2668],{"class":719},"// To JSON\n",[258,2670,2671,2674,2676,2678,2680,2682,2684,2687],{"class":260,"line":19},[258,2672,2673],{"class":263},"jsonBytes",[258,2675,1254],{"class":277},[258,2677,2381],{"class":263},[258,2679,267],{"class":263},[258,2681,2569],{"class":263},[258,2683,278],{"class":277},[258,2685,2686],{"class":513},"ToJSON",[258,2688,2689],{"class":277},"()\n",[258,2691,2692,2694,2696,2699,2701,2703,2705,2708,2710,2714],{"class":260,"line":25},[258,2693,1307],{"class":263},[258,2695,278],{"class":277},[258,2697,2698],{"class":513},"WriteFile",[258,2700,517],{"class":277},[258,2702,2370],{"class":295},[258,2704,1254],{"class":277},[258,2706,2707],{"class":263}," jsonBytes",[258,2709,1254],{"class":277},[258,2711,2713],{"class":2712},"sMAmT"," 0644",[258,2715,697],{"class":277},[258,2717,2718],{"class":260,"line":319},[258,2719,654],{"emptyLinePlaceholder":653},[258,2721,2722],{"class":260,"line":332},[258,2723,2724],{"class":719},"// To YAML\n",[258,2726,2727,2730,2732,2734,2736,2738,2740,2743],{"class":260,"line":345},[258,2728,2729],{"class":263},"yamlBytes",[258,2731,1254],{"class":277},[258,2733,2381],{"class":263},[258,2735,267],{"class":263},[258,2737,2569],{"class":263},[258,2739,278],{"class":277},[258,2741,2742],{"class":513},"ToYAML",[258,2744,2689],{"class":277},[258,2746,2747,2749,2751,2753,2755,2757,2759,2762,2764,2766],{"class":260,"line":351},[258,2748,1307],{"class":263},[258,2750,278],{"class":277},[258,2752,2698],{"class":513},[258,2754,517],{"class":277},[258,2756,1400],{"class":295},[258,2758,1254],{"class":277},[258,2760,2761],{"class":263}," yamlBytes",[258,2763,1254],{"class":277},[258,2765,2713],{"class":2712},[258,2767,697],{"class":277},[258,2769,2770],{"class":260,"line":381},[258,2771,654],{"emptyLinePlaceholder":653},[258,2773,2774],{"class":260,"line":392},[258,2775,2776],{"class":719},"// Or use standard marshallers directly\n",[258,2778,2779,2782,2784,2786,2788,2790,2792,2794,2796,2798,2800,2802],{"class":260,"line":411},[258,2780,2781],{"class":263},"json",[258,2783,278],{"class":277},[258,2785,1302],{"class":513},[258,2787,517],{"class":277},[258,2789,1307],{"class":263},[258,2791,278],{"class":277},[258,2793,1312],{"class":263},[258,2795,1315],{"class":277},[258,2797,1318],{"class":513},[258,2799,517],{"class":277},[258,2801,264],{"class":263},[258,2803,697],{"class":277},[258,2805,2806,2809,2811,2813,2815,2817,2819,2821,2823,2825,2827,2829],{"class":260,"line":424},[258,2807,2808],{"class":263},"yaml",[258,2810,278],{"class":277},[258,2812,1302],{"class":513},[258,2814,517],{"class":277},[258,2816,1307],{"class":263},[258,2818,278],{"class":277},[258,2820,1312],{"class":263},[258,2822,1315],{"class":277},[258,2824,1318],{"class":513},[258,2826,517],{"class":277},[258,2828,264],{"class":263},[258,2830,697],{"class":277},[241,2832,71],{"id":2833},"working-with-schemas",[170,2835,2836,2837,2839],{},"Schemas represent JSON Schema objects. Use ",[255,2838,514],{}," to set the type field:",[249,2841,2843],{"className":251,"code":2842,"language":253,"meta":18,"style":18},"// Simple types\nstringSchema := &openapi.Schema{\n    Type: openapi.NewSchemaType(\"string\"),\n}\n\n// Nullable types (OpenAPI 3.1 style)\nnullableString := &openapi.Schema{\n    Type: openapi.NewSchemaTypes([]string{\"string\", \"null\"}),\n}\n\n// Object with properties\nuserSchema := &openapi.Schema{\n    Type: openapi.NewSchemaType(\"object\"),\n    Properties: map[string]*openapi.Schema{\n        \"id\":    {Type: openapi.NewSchemaType(\"integer\")},\n        \"email\": {Type: openapi.NewSchemaType(\"string\"), Format: \"email\"},\n    },\n    Required: []string{\"id\", \"email\"},\n}\n\n// Array of references\nusersSchema := &openapi.Schema{\n    Type:  openapi.NewSchemaType(\"array\"),\n    Items: &openapi.Schema{Ref: \"#/components/schemas/User\"},\n}\n",[255,2844,2845,2850,2867,2886,2890,2894,2899,2916,2946,2950,2954,2959,2976,2994,3019,3045,3081,3085,3106,3110,3114,3119,3136,3154,3180],{"__ignoreMap":18},[258,2846,2847],{"class":260,"line":9},[258,2848,2849],{"class":719},"// Simple types\n",[258,2851,2852,2855,2857,2859,2861,2863,2865],{"class":260,"line":19},[258,2853,2854],{"class":263},"stringSchema",[258,2856,267],{"class":263},[258,2858,271],{"class":270},[258,2860,167],{"class":274},[258,2862,278],{"class":277},[258,2864,110],{"class":274},[258,2866,283],{"class":277},[258,2868,2869,2872,2874,2876,2878,2880,2882,2884],{"class":260,"line":25},[258,2870,2871],{"class":288},"    Type",[258,2873,292],{"class":277},[258,2875,309],{"class":263},[258,2877,278],{"class":277},[258,2879,514],{"class":513},[258,2881,517],{"class":277},[258,2883,520],{"class":295},[258,2885,1001],{"class":277},[258,2887,2888],{"class":260,"line":319},[258,2889,605],{"class":277},[258,2891,2892],{"class":260,"line":332},[258,2893,654],{"emptyLinePlaceholder":653},[258,2895,2896],{"class":260,"line":345},[258,2897,2898],{"class":719},"// Nullable types (OpenAPI 3.1 style)\n",[258,2900,2901,2904,2906,2908,2910,2912,2914],{"class":260,"line":351},[258,2902,2903],{"class":263},"nullableString",[258,2905,267],{"class":263},[258,2907,271],{"class":270},[258,2909,167],{"class":274},[258,2911,278],{"class":277},[258,2913,110],{"class":274},[258,2915,283],{"class":277},[258,2917,2918,2920,2922,2924,2926,2929,2932,2934,2936,2938,2940,2943],{"class":260,"line":381},[258,2919,2871],{"class":288},[258,2921,292],{"class":277},[258,2923,309],{"class":263},[258,2925,278],{"class":277},[258,2927,2928],{"class":513},"NewSchemaTypes",[258,2930,2931],{"class":277},"([]",[258,2933,366],{"class":274},[258,2935,501],{"class":277},[258,2937,520],{"class":295},[258,2939,1254],{"class":277},[258,2941,2942],{"class":295}," \"null\"",[258,2944,2945],{"class":277},"}),\n",[258,2947,2948],{"class":260,"line":392},[258,2949,605],{"class":277},[258,2951,2952],{"class":260,"line":411},[258,2953,654],{"emptyLinePlaceholder":653},[258,2955,2956],{"class":260,"line":424},[258,2957,2958],{"class":719},"// Object with properties\n",[258,2960,2961,2964,2966,2968,2970,2972,2974],{"class":260,"line":445},[258,2962,2963],{"class":263},"userSchema",[258,2965,267],{"class":263},[258,2967,271],{"class":270},[258,2969,167],{"class":274},[258,2971,278],{"class":277},[258,2973,110],{"class":274},[258,2975,283],{"class":277},[258,2977,2978,2980,2982,2984,2986,2988,2990,2992],{"class":260,"line":458},[258,2979,2871],{"class":288},[258,2981,292],{"class":277},[258,2983,309],{"class":263},[258,2985,278],{"class":277},[258,2987,514],{"class":513},[258,2989,517],{"class":277},[258,2991,1148],{"class":295},[258,2993,1001],{"class":277},[258,2995,2996,2999,3001,3003,3005,3007,3009,3011,3013,3015,3017],{"class":260,"line":471},[258,2997,2998],{"class":288},"    Properties",[258,3000,292],{"class":277},[258,3002,360],{"class":359},[258,3004,363],{"class":277},[258,3006,366],{"class":274},[258,3008,369],{"class":277},[258,3010,1111],{"class":270},[258,3012,167],{"class":274},[258,3014,278],{"class":277},[258,3016,110],{"class":274},[258,3018,283],{"class":277},[258,3020,3021,3024,3026,3029,3031,3033,3035,3037,3039,3041,3043],{"class":260,"line":484},[258,3022,3023],{"class":295},"        \"id\"",[258,3025,292],{"class":277},[258,3027,3028],{"class":277},"    {",[258,3030,504],{"class":288},[258,3032,292],{"class":277},[258,3034,309],{"class":263},[258,3036,278],{"class":277},[258,3038,514],{"class":513},[258,3040,517],{"class":277},[258,3042,1202],{"class":295},[258,3044,523],{"class":277},[258,3046,3047,3050,3052,3054,3056,3058,3060,3062,3064,3066,3068,3071,3074,3076,3079],{"class":260,"line":526},[258,3048,3049],{"class":295},"        \"email\"",[258,3051,292],{"class":277},[258,3053,565],{"class":277},[258,3055,504],{"class":288},[258,3057,292],{"class":277},[258,3059,309],{"class":263},[258,3061,278],{"class":277},[258,3063,514],{"class":513},[258,3065,517],{"class":277},[258,3067,520],{"class":295},[258,3069,3070],{"class":277},"),",[258,3072,3073],{"class":288}," Format",[258,3075,292],{"class":277},[258,3077,3078],{"class":295}," \"email\"",[258,3080,576],{"class":277},[258,3082,3083],{"class":260,"line":532},[258,3084,348],{"class":277},[258,3086,3087,3090,3092,3094,3096,3098,3100,3102,3104],{"class":260,"line":557},[258,3088,3089],{"class":288},"    Required",[258,3091,292],{"class":277},[258,3093,432],{"class":277},[258,3095,366],{"class":274},[258,3097,501],{"class":277},[258,3099,1251],{"class":295},[258,3101,1254],{"class":277},[258,3103,3078],{"class":295},[258,3105,576],{"class":277},[258,3107,3108],{"class":260,"line":579},[258,3109,605],{"class":277},[258,3111,3112],{"class":260,"line":585},[258,3113,654],{"emptyLinePlaceholder":653},[258,3115,3116],{"class":260,"line":591},[258,3117,3118],{"class":719},"// Array of references\n",[258,3120,3121,3124,3126,3128,3130,3132,3134],{"class":260,"line":597},[258,3122,3123],{"class":263},"usersSchema",[258,3125,267],{"class":263},[258,3127,271],{"class":270},[258,3129,167],{"class":274},[258,3131,278],{"class":277},[258,3133,110],{"class":274},[258,3135,283],{"class":277},[258,3137,3138,3140,3142,3144,3146,3148,3150,3152],{"class":260,"line":602},[258,3139,2871],{"class":288},[258,3141,292],{"class":277},[258,3143,989],{"class":263},[258,3145,278],{"class":277},[258,3147,514],{"class":513},[258,3149,517],{"class":277},[258,3151,998],{"class":295},[258,3153,1001],{"class":277},[258,3155,3156,3159,3161,3163,3165,3167,3169,3171,3173,3175,3178],{"class":260,"line":855},[258,3157,3158],{"class":288},"    Items",[258,3160,292],{"class":277},[258,3162,271],{"class":270},[258,3164,167],{"class":274},[258,3166,278],{"class":277},[258,3168,110],{"class":274},[258,3170,501],{"class":277},[258,3172,1022],{"class":288},[258,3174,292],{"class":277},[258,3176,3177],{"class":295}," \"#/components/schemas/User\"",[258,3179,576],{"class":277},[258,3181,3182],{"class":260,"line":868},[258,3183,605],{"class":277},[241,3185,76],{"id":3186},"using-references",[170,3188,3189,3190,3192],{},"Reference reusable components with the ",[255,3191,1022],{}," field:",[249,3194,3196],{"className":251,"code":3195,"language":253,"meta":18,"style":18},"spec := &openapi.OpenAPI{\n    // ... info, paths ...\n    Components: &openapi.Components{\n        Schemas: map[string]*openapi.Schema{\n            \"Error\": {\n                Type: openapi.NewSchemaType(\"object\"),\n                Properties: map[string]*openapi.Schema{\n                    \"code\":    {Type: openapi.NewSchemaType(\"integer\")},\n                    \"message\": {Type: openapi.NewSchemaType(\"string\")},\n                },\n            },\n        },\n        Responses: map[string]*openapi.Response{\n            \"NotFound\": {\n                Description: \"Resource not found\",\n                Content: map[string]openapi.MediaType{\n                    \"application/json\": {\n                        Schema: &openapi.Schema{Ref: \"#/components/schemas/Error\"},\n                    },\n                },\n            },\n        },\n    },\n}\n\n// Reference in an operation\noperation := &openapi.Operation{\n    Responses: map[string]openapi.Response{\n        \"404\": {Ref: \"#/components/responses/NotFound\"},\n    },\n}\n",[255,3197,3198,3214,3219,3236,3261,3270,3289,3314,3339,3364,3368,3372,3376,3401,3410,3422,3445,3454,3480,3484,3488,3492,3496,3500,3504,3508,3513,3530,3553,3571,3575],{"__ignoreMap":18},[258,3199,3200,3202,3204,3206,3208,3210,3212],{"class":260,"line":9},[258,3201,264],{"class":263},[258,3203,267],{"class":263},[258,3205,271],{"class":270},[258,3207,167],{"class":274},[258,3209,278],{"class":277},[258,3211,168],{"class":274},[258,3213,283],{"class":277},[258,3215,3216],{"class":260,"line":19},[258,3217,3218],{"class":719},"    // ... info, paths ...\n",[258,3220,3221,3224,3226,3228,3230,3232,3234],{"class":260,"line":25},[258,3222,3223],{"class":288},"    Components",[258,3225,292],{"class":277},[258,3227,271],{"class":270},[258,3229,167],{"class":274},[258,3231,278],{"class":277},[258,3233,120],{"class":274},[258,3235,283],{"class":277},[258,3237,3238,3241,3243,3245,3247,3249,3251,3253,3255,3257,3259],{"class":260,"line":319},[258,3239,3240],{"class":288},"        Schemas",[258,3242,292],{"class":277},[258,3244,360],{"class":359},[258,3246,363],{"class":277},[258,3248,366],{"class":274},[258,3250,369],{"class":277},[258,3252,1111],{"class":270},[258,3254,167],{"class":274},[258,3256,278],{"class":277},[258,3258,110],{"class":274},[258,3260,283],{"class":277},[258,3262,3263,3266,3268],{"class":260,"line":332},[258,3264,3265],{"class":295},"            \"Error\"",[258,3267,292],{"class":277},[258,3269,389],{"class":277},[258,3271,3272,3275,3277,3279,3281,3283,3285,3287],{"class":260,"line":345},[258,3273,3274],{"class":288},"                Type",[258,3276,292],{"class":277},[258,3278,309],{"class":263},[258,3280,278],{"class":277},[258,3282,514],{"class":513},[258,3284,517],{"class":277},[258,3286,1148],{"class":295},[258,3288,1001],{"class":277},[258,3290,3291,3294,3296,3298,3300,3302,3304,3306,3308,3310,3312],{"class":260,"line":351},[258,3292,3293],{"class":288},"                Properties",[258,3295,292],{"class":277},[258,3297,360],{"class":359},[258,3299,363],{"class":277},[258,3301,366],{"class":274},[258,3303,369],{"class":277},[258,3305,1111],{"class":270},[258,3307,167],{"class":274},[258,3309,278],{"class":277},[258,3311,110],{"class":274},[258,3313,283],{"class":277},[258,3315,3316,3319,3321,3323,3325,3327,3329,3331,3333,3335,3337],{"class":260,"line":381},[258,3317,3318],{"class":295},"                    \"code\"",[258,3320,292],{"class":277},[258,3322,3028],{"class":277},[258,3324,504],{"class":288},[258,3326,292],{"class":277},[258,3328,309],{"class":263},[258,3330,278],{"class":277},[258,3332,514],{"class":513},[258,3334,517],{"class":277},[258,3336,1202],{"class":295},[258,3338,523],{"class":277},[258,3340,3341,3344,3346,3348,3350,3352,3354,3356,3358,3360,3362],{"class":260,"line":392},[258,3342,3343],{"class":295},"                    \"message\"",[258,3345,292],{"class":277},[258,3347,565],{"class":277},[258,3349,504],{"class":288},[258,3351,292],{"class":277},[258,3353,309],{"class":263},[258,3355,278],{"class":277},[258,3357,514],{"class":513},[258,3359,517],{"class":277},[258,3361,520],{"class":295},[258,3363,523],{"class":277},[258,3365,3366],{"class":260,"line":411},[258,3367,582],{"class":277},[258,3369,3370],{"class":260,"line":424},[258,3371,588],{"class":277},[258,3373,3374],{"class":260,"line":445},[258,3375,594],{"class":277},[258,3377,3378,3381,3383,3385,3387,3389,3391,3393,3395,3397,3399],{"class":260,"line":458},[258,3379,3380],{"class":288},"        Responses",[258,3382,292],{"class":277},[258,3384,360],{"class":359},[258,3386,363],{"class":277},[258,3388,366],{"class":274},[258,3390,369],{"class":277},[258,3392,1111],{"class":270},[258,3394,167],{"class":274},[258,3396,278],{"class":277},[258,3398,552],{"class":274},[258,3400,283],{"class":277},[258,3402,3403,3406,3408],{"class":260,"line":471},[258,3404,3405],{"class":295},"            \"NotFound\"",[258,3407,292],{"class":277},[258,3409,389],{"class":277},[258,3411,3412,3415,3417,3420],{"class":260,"line":484},[258,3413,3414],{"class":288},"                Description",[258,3416,292],{"class":277},[258,3418,3419],{"class":295}," \"Resource not found\"",[258,3421,299],{"class":277},[258,3423,3424,3427,3429,3431,3433,3435,3437,3439,3441,3443],{"class":260,"line":526},[258,3425,3426],{"class":288},"                Content",[258,3428,292],{"class":277},[258,3430,360],{"class":359},[258,3432,363],{"class":277},[258,3434,366],{"class":274},[258,3436,369],{"class":277},[258,3438,167],{"class":274},[258,3440,278],{"class":277},[258,3442,948],{"class":274},[258,3444,283],{"class":277},[258,3446,3447,3450,3452],{"class":260,"line":532},[258,3448,3449],{"class":295},"                    \"application/json\"",[258,3451,292],{"class":277},[258,3453,389],{"class":277},[258,3455,3456,3459,3461,3463,3465,3467,3469,3471,3473,3475,3478],{"class":260,"line":557},[258,3457,3458],{"class":288},"                        Schema",[258,3460,292],{"class":277},[258,3462,271],{"class":270},[258,3464,167],{"class":274},[258,3466,278],{"class":277},[258,3468,110],{"class":274},[258,3470,501],{"class":277},[258,3472,1022],{"class":288},[258,3474,292],{"class":277},[258,3476,3477],{"class":295}," \"#/components/schemas/Error\"",[258,3479,576],{"class":277},[258,3481,3482],{"class":260,"line":579},[258,3483,1059],{"class":277},[258,3485,3486],{"class":260,"line":585},[258,3487,582],{"class":277},[258,3489,3490],{"class":260,"line":591},[258,3491,588],{"class":277},[258,3493,3494],{"class":260,"line":597},[258,3495,594],{"class":277},[258,3497,3498],{"class":260,"line":602},[258,3499,348],{"class":277},[258,3501,3502],{"class":260,"line":855},[258,3503,605],{"class":277},[258,3505,3506],{"class":260,"line":868},[258,3507,654],{"emptyLinePlaceholder":653},[258,3509,3510],{"class":260,"line":881},[258,3511,3512],{"class":719},"// Reference in an operation\n",[258,3514,3515,3518,3520,3522,3524,3526,3528],{"class":260,"line":905},[258,3516,3517],{"class":263},"operation",[258,3519,267],{"class":263},[258,3521,271],{"class":270},[258,3523,167],{"class":274},[258,3525,278],{"class":277},[258,3527,406],{"class":274},[258,3529,283],{"class":277},[258,3531,3532,3535,3537,3539,3541,3543,3545,3547,3549,3551],{"class":260,"line":915},[258,3533,3534],{"class":288},"    Responses",[258,3536,292],{"class":277},[258,3538,360],{"class":359},[258,3540,363],{"class":277},[258,3542,366],{"class":274},[258,3544,369],{"class":277},[258,3546,167],{"class":274},[258,3548,278],{"class":277},[258,3550,552],{"class":274},[258,3552,283],{"class":277},[258,3554,3555,3558,3560,3562,3564,3566,3569],{"class":260,"line":928},[258,3556,3557],{"class":295},"        \"404\"",[258,3559,292],{"class":277},[258,3561,565],{"class":277},[258,3563,1022],{"class":288},[258,3565,292],{"class":277},[258,3567,3568],{"class":295}," \"#/components/responses/NotFound\"",[258,3570,576],{"class":277},[258,3572,3573],{"class":260,"line":953},[258,3574,348],{"class":277},[258,3576,3577],{"class":260,"line":963},[258,3578,605],{"class":277},[241,3580,81],{"id":3581},"security-schemes",[170,3583,3584],{},"Define authentication methods in components:",[249,3586,3588],{"className":251,"code":3587,"language":253,"meta":18,"style":18},"spec.Components = &openapi.Components{\n    SecuritySchemes: map[string]*openapi.SecurityScheme{\n        \"bearerAuth\": {\n            Type:         \"http\",\n            Scheme:       \"bearer\",\n            BearerFormat: \"JWT\",\n        },\n        \"apiKey\": {\n            Type: \"apiKey\",\n            Name: \"X-API-Key\",\n            In:   \"header\",\n        },\n    },\n}\n\n// Apply globally\nspec.Security = []openapi.SecurityRequirement{\n    {\"bearerAuth\": {}},\n}\n\n// Or per-operation\noperation.Security = []openapi.SecurityRequirement{\n    {\"apiKey\": {}},\n}\n",[255,3589,3590,3610,3636,3645,3657,3669,3681,3685,3694,3705,3717,3729,3733,3737,3741,3745,3750,3771,3783,3787,3791,3796,3816,3827],{"__ignoreMap":18},[258,3591,3592,3594,3596,3598,3600,3602,3604,3606,3608],{"class":260,"line":9},[258,3593,264],{"class":263},[258,3595,278],{"class":277},[258,3597,120],{"class":263},[258,3599,2326],{"class":263},[258,3601,271],{"class":270},[258,3603,167],{"class":274},[258,3605,278],{"class":277},[258,3607,120],{"class":274},[258,3609,283],{"class":277},[258,3611,3612,3615,3617,3619,3621,3623,3625,3627,3629,3631,3634],{"class":260,"line":19},[258,3613,3614],{"class":288},"    SecuritySchemes",[258,3616,292],{"class":277},[258,3618,360],{"class":359},[258,3620,363],{"class":277},[258,3622,366],{"class":274},[258,3624,369],{"class":277},[258,3626,1111],{"class":270},[258,3628,167],{"class":274},[258,3630,278],{"class":277},[258,3632,3633],{"class":274},"SecurityScheme",[258,3635,283],{"class":277},[258,3637,3638,3641,3643],{"class":260,"line":25},[258,3639,3640],{"class":295},"        \"bearerAuth\"",[258,3642,292],{"class":277},[258,3644,389],{"class":277},[258,3646,3647,3650,3652,3655],{"class":260,"line":319},[258,3648,3649],{"class":288},"            Type",[258,3651,292],{"class":277},[258,3653,3654],{"class":295},"         \"http\"",[258,3656,299],{"class":277},[258,3658,3659,3662,3664,3667],{"class":260,"line":332},[258,3660,3661],{"class":288},"            Scheme",[258,3663,292],{"class":277},[258,3665,3666],{"class":295},"       \"bearer\"",[258,3668,299],{"class":277},[258,3670,3671,3674,3676,3679],{"class":260,"line":345},[258,3672,3673],{"class":288},"            BearerFormat",[258,3675,292],{"class":277},[258,3677,3678],{"class":295}," \"JWT\"",[258,3680,299],{"class":277},[258,3682,3683],{"class":260,"line":351},[258,3684,594],{"class":277},[258,3686,3687,3690,3692],{"class":260,"line":381},[258,3688,3689],{"class":295},"        \"apiKey\"",[258,3691,292],{"class":277},[258,3693,389],{"class":277},[258,3695,3696,3698,3700,3703],{"class":260,"line":392},[258,3697,3649],{"class":288},[258,3699,292],{"class":277},[258,3701,3702],{"class":295}," \"apiKey\"",[258,3704,299],{"class":277},[258,3706,3707,3710,3712,3715],{"class":260,"line":411},[258,3708,3709],{"class":288},"            Name",[258,3711,292],{"class":277},[258,3713,3714],{"class":295}," \"X-API-Key\"",[258,3716,299],{"class":277},[258,3718,3719,3722,3724,3727],{"class":260,"line":424},[258,3720,3721],{"class":288},"            In",[258,3723,292],{"class":277},[258,3725,3726],{"class":295},"   \"header\"",[258,3728,299],{"class":277},[258,3730,3731],{"class":260,"line":445},[258,3732,594],{"class":277},[258,3734,3735],{"class":260,"line":458},[258,3736,348],{"class":277},[258,3738,3739],{"class":260,"line":471},[258,3740,605],{"class":277},[258,3742,3743],{"class":260,"line":484},[258,3744,654],{"emptyLinePlaceholder":653},[258,3746,3747],{"class":260,"line":526},[258,3748,3749],{"class":719},"// Apply globally\n",[258,3751,3752,3754,3756,3758,3760,3762,3764,3766,3769],{"class":260,"line":532},[258,3753,264],{"class":263},[258,3755,278],{"class":277},[258,3757,125],{"class":263},[258,3759,2326],{"class":263},[258,3761,432],{"class":277},[258,3763,167],{"class":274},[258,3765,278],{"class":277},[258,3767,3768],{"class":274},"SecurityRequirement",[258,3770,283],{"class":277},[258,3772,3773,3775,3778,3780],{"class":260,"line":557},[258,3774,3028],{"class":277},[258,3776,3777],{"class":295},"\"bearerAuth\"",[258,3779,292],{"class":277},[258,3781,3782],{"class":277}," {}},\n",[258,3784,3785],{"class":260,"line":579},[258,3786,605],{"class":277},[258,3788,3789],{"class":260,"line":585},[258,3790,654],{"emptyLinePlaceholder":653},[258,3792,3793],{"class":260,"line":591},[258,3794,3795],{"class":719},"// Or per-operation\n",[258,3797,3798,3800,3802,3804,3806,3808,3810,3812,3814],{"class":260,"line":597},[258,3799,3517],{"class":263},[258,3801,278],{"class":277},[258,3803,125],{"class":263},[258,3805,2326],{"class":263},[258,3807,432],{"class":277},[258,3809,167],{"class":274},[258,3811,278],{"class":277},[258,3813,3768],{"class":274},[258,3815,283],{"class":277},[258,3817,3818,3820,3823,3825],{"class":260,"line":602},[258,3819,3028],{"class":277},[258,3821,3822],{"class":295},"\"apiKey\"",[258,3824,292],{"class":277},[258,3826,3782],{"class":277},[258,3828,3829],{"class":260,"line":855},[258,3830,605],{"class":277},[1556,3832,3833],{},"html pre.shiki code .sUt3r, html code.shiki .sUt3r{--shiki-default:var(--shiki-keyword)}html pre.shiki code .sYBwO, html code.shiki .sYBwO{--shiki-default:var(--shiki-type)}html pre.shiki code .soy-K, html code.shiki .soy-K{--shiki-default:#BBBBBB}html pre.shiki code .sxAnc, html code.shiki .sxAnc{--shiki-default:var(--shiki-string)}html pre.shiki code .s5klm, html code.shiki .s5klm{--shiki-default:var(--shiki-function)}html pre.shiki code .sq5bi, html code.shiki .sq5bi{--shiki-default:var(--shiki-punctuation)}html pre.shiki code .sh8_p, html code.shiki .sh8_p{--shiki-default:var(--shiki-text)}html pre.shiki code .sW3Qg, html code.shiki .sW3Qg{--shiki-default:var(--shiki-operator)}html pre.shiki code .sBGCq, html code.shiki .sBGCq{--shiki-default:var(--shiki-property)}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sLkEo, html code.shiki .sLkEo{--shiki-default:var(--shiki-comment)}html pre.shiki code .scyPU, html code.shiki .scyPU{--shiki-default:var(--shiki-placeholder)}html pre.shiki code .suWN2, html code.shiki .suWN2{--shiki-default:var(--shiki-tag)}html pre.shiki code .sMAmT, html code.shiki .sMAmT{--shiki-default:var(--shiki-number)}",{"title":18,"searchDepth":19,"depth":19,"links":3835},[3836,3837,3838,3839,3840,3841],{"id":2028,"depth":19,"text":56},{"id":2336,"depth":19,"text":61},{"id":2655,"depth":19,"text":66},{"id":2833,"depth":19,"text":71},{"id":3186,"depth":19,"text":76},{"id":3581,"depth":19,"text":81},{},"2025-01-07T00:00:00.000Z",null,{"title":48,"description":50},[167,3847],"quickstart","ROl9Hz8O2SbGpUAB7TtZRMuOxCpp9bEz1g-0RUcLt8c",[3850,3851],{"title":6,"path":5,"stem":145,"description":8,"children":-1},{"title":86,"path":85,"stem":149,"description":88,"children":-1},1776113883993]