Documentation
¶
Index ¶
- Variables
- func GenerateSchema(obj any) ([]byte, error)
- func GenerateSchemaWithCommentsFrom(obj any, commentsFrom string) ([]byte, error)
- func ValidatePlaybookSpec(schema []byte) (error, error)
- func ValidateSpec(path string, schema []byte) (error, error)
- func WriteSchemaToFile(path string, obj any) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Schemas embed.FS
Functions ¶
func GenerateSchema ¶ added in v1.0.486
GenerateSchema reflects an object into JSON schema and enriches it with Go comments.
func GenerateSchemaWithCommentsFrom ¶ added in v1.0.1265
GenerateSchemaWithCommentsFrom reflects obj into JSON schema but loads Go doc comments from commentsFrom instead of obj's own package. Use this when the reflected object lives in a binary's main package (e.g. a code generator) but the schema should carry comments from a library package.
func ValidatePlaybookSpec ¶ added in v1.0.350
func WriteSchemaToFile ¶ added in v1.0.486
WriteSchemaToFile generates schema bytes for an object and writes them to disk.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.