Documentation
¶
Overview ¶
Package dart generates a typed Dart client SDK from an AuthSome OpenAPI spec.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldDef ¶
type FieldDef struct {
Name string // Dart field name (camelCase)
JSONName string // Original JSON key
Type string // Dart type
Optional bool
}
FieldDef represents a field in a Dart class.
type GeneratedFile ¶
GeneratedFile represents a single generated file.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator produces Dart SDK code from an OpenAPI spec.
func NewGenerator ¶
func NewGenerator(cfg GeneratorConfig) *Generator
NewGenerator creates a Dart SDK generator.
type GeneratorConfig ¶
type GeneratorConfig struct {
// PackageName is the Dart package name (default: "authsome_core").
PackageName string
// PackageVersion is the Dart package version (default: "0.1.0").
PackageVersion string
// OutputMode controls what files are generated.
// "standalone" (default) — full Dart package (types, client, pubspec).
// "embedded" — only api_types.dart and api_client.dart for embedding.
OutputMode string
// MethodOverrides maps operationID to a custom method name.
MethodOverrides map[string]string
}
GeneratorConfig configures the Dart SDK generator.
type OperationDef ¶
type OperationDef struct {
Name string
Method string
Path string
Summary string
HasBody bool
FormBody bool
BodyType string // Dart type of the request body
ResponseType string // Dart type of the response
AuthRequired bool
PathParams []PathParamDef
QueryParams []QueryParamDef
}
OperationDef represents a generated client method.
type PathParamDef ¶
type PathParamDef struct {
Name string // Original name from the spec
DartName string // Dart parameter name (camelCase)
}
PathParamDef represents a path parameter in an operation.
type QueryParamDef ¶
type QueryParamDef struct {
Name string // Original name from the spec
DartName string // Dart parameter name
Type string // Dart type ("String", "List<String>")
Required bool
// Repeated marks an array-typed query parameter, which is sent once per
// value rather than once in total. Query parameters default to style form
// with explode true, so an array in the document means exactly that.
Repeated bool
}
QueryParamDef represents a query parameter in an operation.
type TemplateData ¶
type TemplateData struct {
PackageName string
PackageVersion string
OutputMode string
Types []TypeDef
Operations []OperationDef
}
TemplateData holds all data passed to templates.
Click to show internal directories.
Click to hide internal directories.