Documentation ¶
Index ¶
- Constants
- func DeReference(f *ast.File, rt *Runtime) func(path string) (*apiextv1.JSONSchemaProps, error)
- func FlattenSchema(src apiextv1.JSONSchemaProps) apiextv1.JSONSchemaProps
- func FromCueAST(rt *Runtime, cueSchema []ast.Decl) (*apiextv1.JSONSchemaProps, error)
- func GenerateOpenAPISchema(cueTpl string, schemaType string) (*apiextv1.JSONSchemaProps, error)
- func GetFieldByLabel(n ast.Node, label string) (*ast.Field, error)
- func IsFieldWithLabel(n ast.Node, label string) bool
- type Runtime
Constants ¶
View Source
const ( SchemaFieldName = "schemas" ComponentFieldName = "components" DefaultSchemaName = "spec" SchemaStructType = "object" )
Variables ¶
This section is empty.
Functions ¶
func DeReference ¶
func FlattenSchema ¶
func FlattenSchema(src apiextv1.JSONSchemaProps) apiextv1.JSONSchemaProps
FlattenSchema flattens the given schema to a single level.
func FromCueAST ¶
func GenerateOpenAPISchema ¶
func GenerateOpenAPISchema(cueTpl string, schemaType string) (*apiextv1.JSONSchemaProps, error)
GenerateOpenAPISchema generates openapi schema from cue type Definitions.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func (*Runtime) Underlying ¶
Click to show internal directories.
Click to hide internal directories.