openapi

package
v0.0.0-...-bcf26a6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeString  = "string"
	TypeBoolean = "boolean"
	TypeInteger = "integer"
	TypeNumber  = "number"
	TypeObject  = "object"
	TypeArray   = "array"
)

Constants for the OpenAPI types.

View Source
const (
	FormatInt64 = "int64"
)

Known Formats.

Variables

This section is empty.

Functions

func BuildValidationFunc

func BuildValidationFunc(s *openapi3.Schema) string

BuildValidationFunc builds a Terraform validation from an OpenAPI schema.

func ConvertToTFSchema

func ConvertToTFSchema(
	name string,
	scope *tf.TerraformScope,
	s *openapi3.Schema,
) (*tf.TerraformSchema, error)

ConvertToTFSchema converts an OpenAPI schema to a Terraform schema.

func CreateTFSchemaFromOpenAPI

func CreateTFSchemaFromOpenAPI(path string, outputFolderPath string) error

func GetTFType

func GetTFType(s *openapi3.Schema) (string, error)

GetTFType returns the Terraform type that corresponds to the given OpenAPI type.

func GetTFValidationFunc

func GetTFValidationFunc(format string) string

GetTFValidationFunc returns a Terraform validation function that corresponds to the given format.

func OpenAPI3ToTerraform

func OpenAPI3ToTerraform(filePath string) (*tf.TerraformScope, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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