generators

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatTypeMapping

type FormatTypeMapping struct {
	Type   string // The type name in the target language
	Import string // The import/package path needed (if any)
}

FormatTypeMapping describes how to map a JSON Schema format to a target language type

type GeneratedFile

type GeneratedFile struct {
	// Filename is the suggested filename for this output (e.g., "User.java", "types.ts")
	Filename string
	// Content is the generated file content
	Content []byte
}

GeneratedFile represents a single generated output file

type Generator

type Generator interface {
	Generate(ir *ir.IR, opts GeneratorOptions, genOpts ...GeneratorOption) ([]GeneratedFile, error)
}

type GeneratorOption

type GeneratorOption interface {
	OptionValue() string
}

GeneratorOption is a marker interface for language-specific generator options. Each generator implementation defines its own option types that satisfy this interface.

type GeneratorOptions

type GeneratorOptions struct {
	// FormatMappings allows customizing how JSON Schema formats map to target types
	// Key is the IRFormat, value is a target-specific type configuration
	FormatMappings map[ir.IRFormat]FormatTypeMapping
}

GeneratorOptions provides generic options for all code generators

type GlobalOptions

type GlobalOptions struct {
	Language          Language
	FormatTypeMapping map[ir.IRFormat]FormatTypeMapping
}

type Language

type Language string
const (
	LanguageGo            Language = "golang"
	LanguageTypeScript    Language = "typescript"
	LanguageTypeScriptZod Language = "typescript-zod"
	LanguageJava          Language = "java"
	LanguagePython        Language = "python"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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