Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.