oaspec/codegen/context
Types
Context for code generation, carrying all needed state. Only accepts a resolved spec — codegen must not operate on unresolved ASTs.
pub type Context {
Context(
spec: spec.OpenApiSpec(spec.Resolved),
config: config.Config,
)
}
Constructors
-
Context( spec: spec.OpenApiSpec(spec.Resolved), config: config.Config, )
Target for a generated file, indicating where it should be written.
pub type FileTarget {
SharedTarget
ServerTarget
ClientTarget
}
Constructors
-
SharedTarget -
ServerTarget -
ClientTarget
A generated file with its path, content, and output target.
pub type GeneratedFile {
GeneratedFile(
path: String,
content: String,
target: FileTarget,
)
}
Constructors
-
GeneratedFile(path: String, content: String, target: FileTarget)
Values
pub fn new(
spec: spec.OpenApiSpec(spec.Resolved),
config: config.Config,
) -> Context
Create a new generation context from a resolved spec.