schema

package
v1.11.8 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ScoreSchemaV1b1 string

Functions

func ApplyCommonUpgradeTransforms added in v1.1.0

func ApplyCommonUpgradeTransforms(rawScore map[string]interface{}) ([]string, error)

ApplyCommonUpgradeTransforms when we fix aspects of the score spec over time, we sometimes need to break compatibility. To reduce affects on users, we can apply a sequence of transformations to the yaml decoded structure so that we can fix things on their behalf. This reduces the impact on existing workflows. This function returns messages regarding any changes it has made or an error if the structure was unexpected. NOTE: this method should only be used for tools or utilities where there is already an established use-case and workflow for example score-compose and score-humanitec.

func Validate

func Validate(src map[string]interface{}) error

Validate validates the source structure which should be a decoded map. Generally, you must call ApplyCommonUpgradeTransforms on the raw structure first unless the input contains zero deprecated concepts. For all validation errors returned error would be a *jsonschema.ValidationError.

func ValidateJson

func ValidateJson(r io.Reader) error

ValidateJson validates a json structure read from the given reader source. Generally, you must call ApplyCommonUpgradeTransforms on the raw structure first unless the input contains zero deprecated concepts. For all validation errors, the returned error would be a *jsonschema.ValidationError.

func ValidateSpec added in v1.5.0

func ValidateSpec(spec *types.Workload) error

ValidateSpec validates a workload spec structure by serializing it to yaml and calling ValidateYaml.

func ValidateYaml

func ValidateYaml(r io.Reader) error

ValidateYaml validates a yaml structure read from the given reader source. Generally, you must call ApplyCommonUpgradeTransforms on the raw structure first unless the input contains zero deprecated concepts. For all validation errors returned error would be a *jsonschema.ValidationError.

Types

This section is empty.

Jump to

Keyboard shortcuts

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