Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExampleDef ¶ added in v1.23.48
ExampleDef describes a request-body example attached to an OpenAPI operation.
type FieldDef ¶
type FieldDef struct {
APIName string
TerraformName string
GoName string
Type string
ElementType string
Description string
NestedModelName string
NestedAPIModelName string
NestedAttrTypes string
Required bool
Optional bool
Computed bool
OptionalComputed bool
Sensitive bool
PreferState bool
SuppressDiff bool
ForceNew bool
Ignored bool
CustomType string
ElementCustomType string
ReadOnly bool
WriteOnly bool
PathParam bool
QueryParam bool
RequestField bool
UpdateField bool
ApplyStrategy string
PlanModifierHook string
UseStateForUnknown bool
EmitEmpty bool
FixedValue string
Enum []string
Fields []FieldDef
ObjectAsJSON bool
NotNull bool
ValidJSON bool
PipelineFunctionID bool
}
FieldDef describes one Terraform model field.
type OneOfVariantDef ¶
type OneOfVariantDef struct {
APIName string
TerraformName string
GoName string
ModelName string
SchemaName string
DiscriminatorValue string
Fields []FieldDef
}
OneOfVariantDef describes one flattened oneOf variant model.
type OperationDef ¶
type OperationDef struct {
Method string
Path string
OperationID string
RequestSchema string
ResponseSchema string
PathParams []FieldDef
QueryParams []FieldDef
Examples []ExampleDef
ReadAfterWrite bool
PreserveInputsAfterWrite bool
ResetBody any
DeleteHook string
}
OperationDef describes one annotated OpenAPI operation.
type OutputFile ¶
OutputFile describes a generated file decision.
type ResourceDef ¶
type ResourceDef struct {
Name string
FileStem string
TypeName string
StructName string
SchemaName string
Create OperationDef
Read OperationDef
Update OperationDef
Delete OperationDef
List OperationDef
ListName string
ListFileStem string
ListStructName string
ListTypeName string
Fields []FieldDef
OneOfVariants []OneOfVariantDef
Outputs []OutputFile
Action bool
NoRead bool
}
ResourceDef describes one Terraform resource discovered from OpenAPI annotations.
func Parse ¶
func Parse(content []byte) ([]ResourceDef, error)
Parse reads an OpenAPI document and returns annotated Terraform resources.
func ParseFile ¶
func ParseFile(filename string) ([]ResourceDef, error)
ParseFile reads an OpenAPI document and returns annotated Terraform resources.
Click to show internal directories.
Click to hide internal directories.