oaspec/generate
Types
Errors from the pure generation pipeline.
pub type GenerateError {
ValidationErrors(errors: List(validate.ValidationError))
}
Constructors
-
ValidationErrors(errors: List(validate.ValidationError))
Result of a successful code generation run.
pub type GenerationSummary {
GenerationSummary(
files: List(context.GeneratedFile),
spec_title: String,
warnings: List(validate.ValidationError),
)
}
Constructors
-
GenerationSummary( files: List(context.GeneratedFile), spec_title: String, warnings: List(validate.ValidationError), )
Values
pub fn generate(
spec: spec.OpenApiSpec,
cfg: config.Config,
) -> Result(GenerationSummary, GenerateError)
Pure generation pipeline: hoist → dedup → validate → generate files. Takes an already-parsed spec and config; returns generated files or errors. Does not perform IO — callers handle writing files and printing output.
pub fn generate_all_files(
ctx: context.Context,
) -> List(context.GeneratedFile)
Pure file generation: produce all GeneratedFile values without any IO.