sdk

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sdk generates client code from an OpenAPI document.

The output is source the caller owns, in the same spirit as the admin generator: a typed method per operation and a struct/interface per schema, with no runtime dependency beyond the language's standard HTTP client. It is a starting point that compiles, not a framework to configure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name string
	Data []byte
}

File is one generated file, named relative to the output directory.

func Generate

func Generate(doc *core.Document, opts Options) ([]File, error)

Generate renders the document as client source in the requested language.

type Options

type Options struct {
	// Lang is "ts" or "go".
	Lang string
	// Package names the generated Go package. Ignored for TypeScript.
	// Empty means "client".
	Package string
	// BaseURL is the default server the client calls. Empty falls back to the
	// document's first server, and failing that the client requires one at
	// construction.
	BaseURL string
}

Options selects the output language and names the generated artifact.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL