JSONSchemaForRillYAML returns the JSON schema for validating rill.yaml files.
()
| 42 | |
| 43 | // JSONSchemaForRillYAML returns the JSON schema for validating rill.yaml files. |
| 44 | func JSONSchemaForRillYAML() (*jsonschema.Schema, error) { |
| 45 | // Ensure the schema is parsed |
| 46 | parsedRillYAMLSchemaOnce.Do(func() { |
| 47 | var err error |
| 48 | parsedRillYAMLSchema, err = parseSchemaFromYAML(rillYAMLSchema) |
| 49 | if err != nil { |
| 50 | panic(fmt.Sprintf("failed to parse schema: %v", err)) |
| 51 | } |
| 52 | }) |
| 53 | |
| 54 | return parsedRillYAMLSchema, nil |
| 55 | } |
| 56 | |
| 57 | // JSONSchemaForResourceType returns a JSON schema for validating the properties of a given resource type. |
| 58 | // Note: You can use ParseResourceKind to get the ResourceKind from a string. |