package schemaconv
import "k8s.io/kube-openapi/pkg/schemaconv"
Index ¶
- func ToSchema(models proto.Models) (*schema.Schema, error)
- func ToSchemaFromOpenAPI(models map[string]*spec.Schema, preserveUnknownFields bool) (*schema.Schema, error)
- func ToSchemaWithPreserveUnknownFields(models proto.Models, preserveUnknownFields bool) (*schema.Schema, error)
Functions ¶
func ToSchema ¶
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.
Source Files ¶
openapi.go proto_models.go smd.go
- Version
- v0.0.0-20250318190949-c8a335a9a2ff (latest)
- Published
- Mar 18, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 4 weeks ago –
Tools for package owners.