Documentation
¶
Overview ¶
Package diff provides a diff function for OpenAPI Spec 3. Work to enhance the diff with additional aspects of OAS is in-progress.
Index ¶
- type ContentDiff
- type Diff
- type EnumDiff
- type EnumValues
- type MethodDiff
- type ModifiedOperations
- type ModifiedPaths
- type ModifiedResponses
- type ModifiedSchemas
- type OperationList
- type Operations
- type ParamDiffByLocation
- type ParamDiffs
- type ParamNames
- type ParamNamesByLocation
- type ParameterDiff
- type ParametersDiff
- type PathDiff
- type PathList
- type PathSummary
- type PathsDiff
- type ResponseDiff
- type ResponseList
- type ResponsesDiff
- type Result
- type SchemaDiff
- type SchemaList
- type SchemaSummary
- type SchemasDiff
- type Summary
- type ValueDiff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentDiff ¶
type ContentDiff struct { MediaTypeAdded bool `json:"mediaTypeAdded,omitempty"` MediaTypeDeleted bool `json:"mediaTypeDeleted,omitempty"` MediaTypeDiff bool `json:"mediaTypeDiff,omitempty"` SchemaDiff *SchemaDiff `json:"schemaDiff,omitempty"` }
ContentDiff is the diff between two OAS contents
type Diff ¶
type Diff struct { PathDiff *PathsDiff `json:"paths,omitempty"` SchemaDiff *SchemasDiff `json:"schemas,omitempty"` }
Diff describes the changes between two OAS specs
type EnumDiff ¶ added in v0.1.3
type EnumDiff struct { Added EnumValues `json:"added,omitempty"` Deleted EnumValues `json:"deleted,omitempty"` }
EnumDiff is the diff between two OAS enums
type MethodDiff ¶
type MethodDiff struct { ParamDiff *ParametersDiff `json:"parameters,omitempty"` ResponseDiff *ResponsesDiff `json:"responses,omitempty"` }
MethodDiff is the diff between two methods
type ModifiedOperations ¶
type ModifiedOperations map[string]*MethodDiff
ModifiedOperations is a map of HTTP methods to their respective diffs
type ModifiedPaths ¶ added in v0.1.5
ModifiedPaths is a map of paths to their respective diffs
type ModifiedResponses ¶ added in v0.1.5
type ModifiedResponses map[string]ResponseDiff
ModifiedResponses is map of response value to their respective diffs
type ModifiedSchemas ¶
type ModifiedSchemas map[string]*SchemaDiff
ModifiedSchemas is map of schema names to their respective diffs
type OperationList ¶ added in v0.0.9
type OperationList []string
OperationList is a list of operations (methods)
type Operations ¶ added in v0.0.9
type Operations struct { Added OperationList `json:"added,omitempty"` Deleted OperationList `json:"deleted,omitempty"` Modified ModifiedOperations `json:"modified,omitempty"` }
Operations is the diff in operations (methods) of two paths
type ParamDiffByLocation ¶ added in v0.1.4
type ParamDiffByLocation map[string]ParamDiffs
ParamDiffByLocation maps param location (path, query, header or cookie) to param diffs in this location
type ParamDiffs ¶
type ParamDiffs map[string]ParameterDiff
ParamDiffs is map of parameter names to their respective diffs
type ParamNamesByLocation ¶ added in v0.1.4
type ParamNamesByLocation map[string]ParamNames
ParamNamesByLocation maps param location (path, query, header or cookie) to the params in this location
type ParameterDiff ¶ added in v0.1.5
type ParameterDiff struct { DescriptionDiff *ValueDiff `json:"description,omitempty"` StyleDiff *ValueDiff `json:"style,omitempty"` ExplodeDiff *ValueDiff `json:"explode,omitempty"` AllowEmptyValueDiff *ValueDiff `json:"allow_empty_value,omitempty"` AllowReservedDiff *ValueDiff `json:"allow_reserved,omitempty"` DeprecatedDiff *ValueDiff `json:"deprecated,omitempty"` RequiredDiff *ValueDiff `json:"required,omitempty"` SchemaDiff *SchemaDiff `json:"schema,omitempty"` ContentDiff *ContentDiff `json:"content,omitempty"` }
ParameterDiff is a diff between two parameters
type ParametersDiff ¶ added in v0.1.5
type ParametersDiff struct { Added ParamNamesByLocation `json:"added,omitempty"` Deleted ParamNamesByLocation `json:"deleted,omitempty"` Modified ParamDiffByLocation `json:"modified,omitempty"` }
ParametersDiff is the diff of parameters between two two operations
type PathDiff ¶
type PathDiff struct {
Operations `json:"operations,omitempty"`
}
PathDiff is the diff between two paths
type PathSummary ¶ added in v0.0.9
type PathSummary struct { Added int `json:"added,omitempty"` Deleted int `json:"deleted,omitempty"` Modified int `json:"modified,omitempty"` }
PathSummary summarizes the path changes between two specs
type PathsDiff ¶ added in v0.1.5
type PathsDiff struct { Added PathList `json:"added,omitempty"` Deleted PathList `json:"deleted,omitempty"` Modified ModifiedPaths `json:"modified,omitempty"` }
PathsDiff is a diff between two sets of paths
type ResponseDiff ¶ added in v0.1.5
type ResponseDiff struct { }
ResponseDiff is a diff between two responses
type ResponseList ¶ added in v0.1.5
type ResponseList []string
ResponseList is a list of response values
type ResponsesDiff ¶ added in v0.1.5
type ResponsesDiff struct { Added ResponseList `json:"added,omitempty"` Deleted ResponseList `json:"deleted,omitempty"` Modified ModifiedResponses `json:"modified,omitempty"` }
ResponsesDiff is a diff between two sets of responses
type Result ¶ added in v0.0.9
type Result struct { Diff *Diff `json:"diff,omitempty"` Summary *Summary `json:"summary,omitempty"` }
Result includes a diff of changes between two OAS specs and a summary of these changes
type SchemaDiff ¶
type SchemaDiff struct { SchemaAdded bool `json:"schemaAdded,omitempty"` SchemaDeleted bool `json:"schemaDeleted,omitempty"` ValueAdded bool `json:"valueAdded,omitempty"` ValueDeleted bool `json:"valueDeleted,omitempty"` OneOfDiff bool `json:"oneOf,omitempty"` AnyOfDiff bool `json:"anyOf,omitempty"` AllOfDiff bool `json:"allOf,omitempty"` NotDiff bool `json:"not,omitempty"` TypeDiff *ValueDiff `json:"type,omitempty"` TitleDiff *ValueDiff `json:"title,omitempty"` FormatDiff *ValueDiff `json:"format,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty"` EnumDiff *EnumDiff `json:"enum,omitempty"` AdditionalPropertiesAllowedDiff *ValueDiff `json:"additionalPropertiesAllowed,omitempty"` UniqueItemsDiff *ValueDiff `json:"uniqueItems,omitempty"` ExclusiveMinDiff *ValueDiff `json:"exclusiveMin,omitempty"` ExclusiveMaxDiff *ValueDiff `json:"exclusiveMax,omitempty"` NullableDiff *ValueDiff `json:"nullable,omitempty"` ReadOnlyDiff *ValueDiff `json:"readOnlyDiff,omitempty"` WriteOnlyDiff *ValueDiff `json:"writeOnlyDiff,omitempty"` AllowEmptyValueDiff *ValueDiff `json:"allowEmptyValue,omitempty"` DeprecatedDiff *ValueDiff `json:"deprecated,omitempty"` MinDiff *ValueDiff `json:"min,omitempty"` MaxDiff *ValueDiff `json:"max,omitempty"` MultipleOf *ValueDiff `json:"multipleOf,omitempty"` MinLength *ValueDiff `json:"minLength,omitempty"` MaxLength *ValueDiff `json:"maxLength,omitempty"` Pattern *ValueDiff `json:"pattern,omitempty"` MinItems *ValueDiff `json:"minItems,omitempty"` MaxItems *ValueDiff `json:"maxItems,omitempty"` Items bool `json:"items,omitempty"` PropertiesDiff bool `json:"properties,omitempty"` MinProps *ValueDiff `json:"minProps,omitempty"` MaxProps *ValueDiff `json:"maxProps,omitempty"` AdditionalProperties bool `json:"additionalProperties,omitempty"` }
SchemaDiff is a diff between two schemas
type SchemaSummary ¶ added in v0.0.9
type SchemaSummary struct { Added int `json:"added,omitempty"` Deleted int `json:"deleted,omitempty"` Modified int `json:"modified,omitempty"` }
SchemaSummary summarizes the schema changes between two specs
type SchemasDiff ¶ added in v0.1.5
type SchemasDiff struct { Added SchemaList `json:"added,omitempty"` Deleted SchemaList `json:"deleted,omitempty"` Modified ModifiedSchemas `json:"modified,omitempty"` }
SchemasDiff is a diff between two sets of schemas
type Summary ¶ added in v0.0.9
type Summary struct { Diff bool `json:"diff"` PathSummary *PathSummary `json:"paths,omitempty"` SchemaSummary *SchemaSummary `json:"schemas,omitempty"` }
Summary summarizes the changes between two specs