github.com/snyk/vervet/v3@v3.7.0/internal/linter/optic/context.go (about) 1 package optic 2 3 // Context provides Optic with external information needed in order to process 4 // API versioning lifecycle rules. For example, lifecycle rules need to know 5 // when a change is occurring, and what other versions have deprecated the 6 // OpenAPI spec version being evaluated. 7 type Context struct { 8 // ChangeDate is when the proposed change would occur. 9 ChangeDate string `json:"changeDate"` 10 11 // ChangeResource is the proposed change resource name. 12 ChangeResource string `json:"changeResource"` 13 14 // ChangeVersion is the proposed change version. 15 ChangeVersion Version `json:"changeVersion"` 16 17 // ResourceVersions describes other resource version releases. 18 ResourceVersions ResourceVersionReleases `json:"resourceVersions,omitempty"` 19 } 20 21 // Version describes an API resource version, a date and a stability. 22 // Stability is assumed to be GA if not specified. 23 type Version struct { 24 Date string `json:"date"` 25 Stability string `json:"stability,omitempty"` 26 } 27 28 // ResourceVersionReleases describes resource version releases. 29 type ResourceVersionReleases map[string]VersionStabilityReleases 30 31 // VersionStabilityReleases describes version releases. 32 type VersionStabilityReleases map[string]StabilityReleases 33 34 // StabilityReleases describes stability releases. 35 type StabilityReleases map[string]Release 36 37 // Release describes a single resource-version-stability release. 38 type Release struct { 39 // DeprecatedBy indicates the other release version that deprecates this 40 // release. 41 DeprecatedBy Version `json:"deprecatedBy"` 42 }