{"modulePath":"github.com/chainloop-dev/chainloop","version":"v1.140.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package schemavalidators\n\n## Constants\n\n```go\nconst (\n\t// RunnerContextVersion0_1 represents Runner Context version 0.1 schema.\n\tRunnerContextVersion0_1 RunnerContextVersion = \"0.1\"\n\t// CycloneDXVersion1_5 represents CycloneDX version 1.5 schema.\n\tCycloneDXVersion1_5 CycloneDXVersion = \"1.5\"\n\t// CycloneDXVersion1_6 represents CycloneDX version 1.6 schema.\n\tCycloneDXVersion1_6 CycloneDXVersion = \"1.6\"\n\t// CSAFVersion2_0 represents CSAF version 2.0 schema.\n\tCSAFVersion2_0 CSAFVersion = \"2.0\"\n\t// CSAFVersion2_1 represents CSAF version 2.0 schema.\n\tCSAFVersion2_1 CSAFVersion = \"2.1\"\n\t// AIAgentConfigVersion0_1 represents AI Agent Config version 0.1 schema.\n\tAIAgentConfigVersion0_1 AIAgentConfigVersion = \"0.1\"\n\t// AICodingSessionVersion0_1 represents AI Coding Session version 0.1 schema.\n\tAICodingSessionVersion0_1 AICodingSessionVersion = \"0.1\"\n\t// AISecurityContextVersion0_1 represents AI Security Context version 0.1 schema.\n\tAISecurityContextVersion0_1 AISecurityContextVersion = \"0.1\"\n\t// ScorecardVersionV2 represents the OpenSSF Scorecard V2 JSON result schema.\n\tScorecardVersionV2 ScorecardVersion = \"v2\"\n\t// OpenAPIVersion2_0 represents Swagger/OpenAPI version 2.0 schema.\n\tOpenAPIVersion2_0 OpenAPIVersion = \"2.0\"\n\t// OpenAPIVersion3_0 represents OpenAPI version 3.0 schema.\n\tOpenAPIVersion3_0 OpenAPIVersion = \"3.0\"\n\t// OpenAPIVersion3_1 represents OpenAPI version 3.1 schema.\n\tOpenAPIVersion3_1 OpenAPIVersion = \"3.1\"\n\t// OpenAPIVersion3_2 represents OpenAPI version 3.2 schema.\n\tOpenAPIVersion3_2 OpenAPIVersion = \"3.2\"\n\t// AsyncAPIVersion2_6 represents AsyncAPI version 2.6 schema.\n\tAsyncAPIVersion2_6 AsyncAPIVersion = \"2.6\"\n\t// AsyncAPIVersion3_0 represents AsyncAPI version 3.0 schema.\n\tAsyncAPIVersion3_0 AsyncAPIVersion = \"3.0\"\n)\n```\n\n## Variables\n\n```go\nvar ErrInvalidJSONPayload = errors.New(\"invalid JSON payload\")\n```\nErrInvalidJSONPayload represents an error for invalid JSON payload.\n\n## Functions\n\n```go\nfunc ValidateAIAgentConfig(data any, version AIAgentConfigVersion) error\n```\n\n```go\nfunc ValidateAICodingSession(data any, version AICodingSessionVersion) error\n```\nValidateAICodingSession validates the AI coding session schema.\n\n```go\nfunc ValidateAsyncAPI(data interface{}) error\n```\nValidateAsyncAPI validates the given object against an AsyncAPI schema version. It tries 3.0 first, then falls back to 2.6.\n\n```go\nfunc ValidateCSAF(data interface{}) error\n```\nValidateCSAF validates the given object against a CSAF schema version. The schema version is determined by the \"csaf\\_version\" field in the object.\n\n```go\nfunc ValidateChainloopRunnerContext(data interface{}, version RunnerContextVersion) error\n```\nValidateChainloopRunnerContext validates the runner context schema. The schema version is determined by the \"id\" field in the object.\n\n```go\nfunc ValidateCycloneDX(data interface{}, version CycloneDXVersion) error\n```\nValidateCycloneDX validates the given object against the specified CycloneDX schema version.\n\n```go\nfunc ValidateOSSFScorecard(data any, version ScorecardVersion) error\n```\nValidateOSSFScorecard validates the given object against the OpenSSF Scorecard V2 JSON schema.\n\n```go\nfunc ValidateOpenAPI(data interface{}) error\n```\nValidateOpenAPI validates the given object against an OpenAPI/Swagger schema version. It tries 3.2 first, then falls back to 3.1, 3.0, and finally Swagger 2.0.\n\n```go\nfunc ValidateSecurityContext(data any, version AISecurityContextVersion) error\n```\nValidateSecurityContext validates the given object against the specified AI Security Context schema version.\n\nThe argument is the evidence envelope's \\`data\\` payload, not the whole file: the schema is payload-rooted like every other internal schema, and the envelope is asserted by the crafter in Go.\n\n## Types\n\n```go\ntype AIAgentConfigVersion string\n```\nAIAgentConfigVersion represents the version of AI Agent Config schema.\n\n```go\ntype AICodingSessionVersion string\n```\nAICodingSessionVersion represents the version of AI Coding Session schema.\n\n```go\ntype AISecurityContextVersion string\n```\nAISecurityContextVersion represents the version of AI Security Context schema.\n\n```go\ntype AsyncAPIVersion string\n```\nAsyncAPIVersion represents the version of AsyncAPI schema.\n\n```go\ntype CSAFVersion string\n```\nCSAFVersion represents the version of CSAF schema.\n\n```go\ntype CycloneDXVersion string\n```\nCycloneDXVersion represents the version of CycloneDX schema.\n\n```go\ntype OpenAPIVersion string\n```\nOpenAPIVersion represents the version of OpenAPI schema.\n\n```go\ntype RunnerContextVersion string\n```\nRunnerContextVersion represents the version of Runner Context schema.\n\n```go\ntype ScorecardVersion string\n```\n\n","path":"github.com/chainloop-dev/chainloop/internal/schemavalidators","name":"schemavalidators","synopsis":"","isRedistributable":true}
