schemaconv

package
v0.0.0-...-dc4e619 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToSchema

func ToSchema(models proto.Models) (*schema.Schema, error)

ToSchema converts openapi definitions into a schema suitable for structured merge (i.e. kubectl apply v2).

func ToSchemaFromOpenAPI

func ToSchemaFromOpenAPI(models map[string]*spec.Schema, preserveUnknownFields bool) (*schema.Schema, error)

ToSchemaFromOpenAPI converts a directory of OpenAPI schemas to an smd Schema.

  • models: a map from definition name to OpenAPI V3 structural schema for each definition. Key in map is used to resolve references in the schema.
  • preserveUnknownFields: flag indicating whether unknown fields in all schemas should be preserved.
  • returns: nil and an error if there is a parse error, or if schema does not satisfy a required structural schema invariant for conversion. If no error, returns a new smd schema.

Schema should be validated as structural before using with this function, or there may be information lost.

func ToSchemaWithPreserveUnknownFields

func ToSchemaWithPreserveUnknownFields(models proto.Models, preserveUnknownFields bool) (*schema.Schema, error)

ToSchemaWithPreserveUnknownFields converts openapi definitions into a schema suitable for structured merge (i.e. kubectl apply v2), it will preserve unknown fields if specified.

Types

This section is empty.

Jump to

Keyboard shortcuts

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