Documentation
¶
Overview ¶
Package diff provides a diff function for OpenAPI Spec 3.
Index ¶
- type CallbacksDiff
- type ComponentsDiff
- type Config
- type ContactDiff
- type ContentDiff
- type DetailName
- type Diff
- type EncodingDiff
- type EncodingsDiff
- type EnumDiff
- type EnumValues
- type ExtensionsDiff
- type ExternalDocsDiff
- type HeaderDiff
- type HeadersDiff
- type InfoDiff
- type LicenseDiff
- type MethodDiff
- type ModifiedCallbacks
- type ModifiedEncodings
- type ModifiedExtensions
- type ModifiedHeaders
- type ModifiedKeys
- type ModifiedOperations
- type ModifiedPaths
- type ModifiedRequestBodies
- type ModifiedResponses
- type ModifiedSchemas
- type ModifiedSecuritySchemes
- type ModifiedServers
- type ModifiedTags
- type OAuthFlowDiff
- type OAuthFlowsDiff
- type OperationsDiff
- type ParamDiffByLocation
- type ParamDiffs
- type ParamNamesByLocation
- type ParameterDiff
- type ParametersDiff
- type PathDiff
- type PathsDiff
- type RequestBodiesDiff
- type RequestBodyDiff
- type ResponseDiff
- type ResponsesDiff
- type SchemaDiff
- type SchemasDiff
- type SecurityRequirementsDiff
- type SecuritySchemeDiff
- type SecuritySchemesDiff
- type ServerDiff
- type ServersDiff
- type SpecDiff
- type StringList
- type StringMap
- type StringMapDiff
- type StringSet
- type StringsDiff
- type Summary
- type SummaryDetails
- type TagDiff
- type TagsDiff
- type ValueDiff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbacksDiff ¶ added in v0.1.11
type CallbacksDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedCallbacks `json:"modified,omitempty" yaml:"modified,omitempty"` }
CallbacksDiff is a diff between callback objects: https://swagger.io/specification/#callback-object
func (*CallbacksDiff) Empty ¶ added in v0.2.10
func (callbacksDiff *CallbacksDiff) Empty() bool
Empty indicates whether a change was found in this element
type ComponentsDiff ¶ added in v0.2.8
type ComponentsDiff struct { SchemasDiff *SchemasDiff `json:"schemas,omitempty" yaml:"schemas,omitempty"` ParametersDiff *ParametersDiff `json:"parameters,omitempty" yaml:"parameters,omitempty"` HeadersDiff *HeadersDiff `json:"headers,omitempty" yaml:"headers,omitempty"` RequestBodiesDiff *RequestBodiesDiff `json:"requestBodies,omitempty" yaml:"requestBodies,omitempty"` ResponsesDiff *ResponsesDiff `json:"responses,omitempty" yaml:"responses,omitempty"` SecuritySchemesDiff *SecuritySchemesDiff `json:"securitySchemes,omitempty" yaml:"securitySchemes,omitempty"` CallbacksDiff *CallbacksDiff `json:"callbacks,omitempty" yaml:"callbacks,omitempty"` }
ComponentsDiff is the diff between two component objects: https://swagger.io/specification/#components-object
type Config ¶ added in v0.2.1
type Config struct { IncludeExamples bool // whether to include examples in diff or not (ignored by default) IncludeExtensions StringSet // which extensions to include in the diff (default is none) - see https://swagger.io/specification/#specification-extensions Filter string // diff will only include paths that match this regex (optional) Prefix string // a prefix that exists in s1 paths but not in s2 (optional) }
Config includes various settings to control the diff
type ContactDiff ¶ added in v0.3.5
type ContactDiff struct { Added bool `json:"added,omitempty" yaml:"added,omitempty"` Deleted bool `json:"deleted,omitempty" yaml:"deleted,omitempty"` ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` NameDiff *ValueDiff `json:"name,omitempty" yaml:"name,omitempty"` URLDiff *ValueDiff `json:"url,omitempty" yaml:"url,omitempty"` EmailDiff *ValueDiff `json:"email,omitempty" yaml:"email,omitempty"` }
ContactDiff is the diff between two contact objects: https://swagger.io/specification/#contact-object
func (*ContactDiff) Empty ¶ added in v0.3.5
func (diff *ContactDiff) Empty() bool
Empty indicates whether a change was found in this element
type ContentDiff ¶
type ContentDiff struct { MediaTypeAdded bool `json:"mediaTypeAdded,omitempty" yaml:"mediaTypeAdded,omitempty"` MediaTypeDeleted bool `json:"mediaTypeDeleted,omitempty" yaml:"mediaTypeDeleted,omitempty"` MediaTypeDiff bool `json:"mediaType,omitempty" yaml:"mediaType,omitempty"` ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` SchemaDiff *SchemaDiff `json:"schema,omitempty" yaml:"schema,omitempty"` ExampleDiff *ValueDiff `json:"example,omitempty" yaml:"example,omitempty"` // Examples EncodingsDiff *EncodingsDiff `json:"encoding,omitempty" yaml:"encoding,omitempty"` }
ContentDiff is the diff between two content objects each containing a media type object: https://swagger.io/specification/#media-type-object
func (*ContentDiff) Empty ¶ added in v0.2.10
func (contentDiff *ContentDiff) Empty() bool
Empty indicates whether a change was found in this element
type DetailName ¶ added in v0.2.10
type DetailName string
DetailName is the key type of the summary map
const ( PathsDetail DetailName = "paths" SecurityDetail DetailName = "security" ServersDetail DetailName = "servers" TagsDetail DetailName = "tags" SchemasDetail DetailName = "schemas" ParametersDetail DetailName = "parameters" HeadersDetail DetailName = "headers" RequestBodiesDetail DetailName = "requestBodies" ResponsesDetail DetailName = "responses" SecuritySchemesDetail DetailName = "securitySchemes" CallbacksDetail DetailName = "callbacks" )
Component constants are the keys in the summary map
type Diff ¶
type Diff struct { SpecDiff *SpecDiff `json:"spec,omitempty" yaml:"spec,omitempty"` Summary *Summary `json:"summary,omitempty" yaml:"summary,omitempty"` }
Diff describes changes between two OpenAPI specifications including a summary of the changes
func Get ¶ added in v0.1.9
Get calculates the diff between two OpenAPI specifications. References should be resolved before calling this function. This is normally done automatically by loaders. See https://swagger.io/docs/specification/using-ref/ and https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3#SwaggerLoader.ResolveRefsIn.
type EncodingDiff ¶ added in v0.1.17
type EncodingDiff struct { ContentTypeDiff *ValueDiff `json:"contentType,omitempty" yaml:"contentType,omitempty"` HeadersDiff *HeadersDiff `json:"headers,omitempty" yaml:"headers,omitempty"` StyleDiff *ValueDiff `json:"styleDiff,omitempty" yaml:"styleDiff,omitempty"` ExplodeDiff *ValueDiff `json:"explode,omitempty" yaml:"explode,omitempty"` AllowReservedDiff *ValueDiff `json:"allowReservedDiff,omitempty" yaml:"allowReservedDiff,omitempty"` }
EncodingDiff is a diff between encoding objects: https://swagger.io/specification/#encoding-object
func (*EncodingDiff) Empty ¶ added in v0.2.10
func (diff *EncodingDiff) Empty() bool
Empty indicates whether a change was found in this element
type EncodingsDiff ¶ added in v0.1.17
type EncodingsDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedEncodings `json:"modified,omitempty" yaml:"modified,omitempty"` }
EncodingsDiff is a diff between two sets of encoding objects: https://swagger.io/specification/#encoding-object
func (*EncodingsDiff) Empty ¶ added in v0.2.10
func (diff *EncodingsDiff) Empty() bool
Empty indicates whether a change was found in this element
type EnumDiff ¶ added in v0.1.3
type EnumDiff struct { Added EnumValues `json:"added,omitempty" yaml:"added,omitempty"` Deleted EnumValues `json:"deleted,omitempty" yaml:"deleted,omitempty"` }
EnumDiff is the diff between two enums
type ExtensionsDiff ¶ added in v0.1.20
type ExtensionsDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedExtensions `json:"modified,omitempty" yaml:"modified,omitempty"` }
ExtensionsDiff is a diff between two sets of specification extensions: https://swagger.io/specification/#specification-extensions
func (*ExtensionsDiff) Empty ¶ added in v0.2.10
func (diff *ExtensionsDiff) Empty() bool
Empty indicates whether a change was found in this element
type ExternalDocsDiff ¶ added in v0.3.5
type ExternalDocsDiff struct { Added bool `json:"added,omitempty" yaml:"added,omitempty"` Deleted bool `json:"deleted,omitempty" yaml:"deleted,omitempty"` ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` URLDiff *ValueDiff `json:"url,omitempty" yaml:"url,omitempty"` }
ExternalDocsDiff is the diff between two external documentation objects: https://swagger.io/specification/#external-documentation-object
func (*ExternalDocsDiff) Empty ¶ added in v0.3.5
func (diff *ExternalDocsDiff) Empty() bool
Empty indicates whether a change was found in this element
type HeaderDiff ¶ added in v0.1.10
type HeaderDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` DeprecatedDiff *ValueDiff `json:"deprecated,omitempty" yaml:"deprecated,omitempty"` RequiredDiff *ValueDiff `json:"required,omitempty" yaml:"required,omitempty"` ExampleDiff *ValueDiff `json:"example,omitempty" yaml:"example,omitempty"` // Examples SchemaDiff *SchemaDiff `json:"schema,omitempty" yaml:"schema,omitempty"` ContentDiff *ContentDiff `json:"content,omitempty" yaml:"content,omitempty"` }
HeaderDiff is a diff between header objects: https://swagger.io/specification/#header-object
func (*HeaderDiff) Empty ¶ added in v0.2.10
func (headerDiff *HeaderDiff) Empty() bool
Empty indicates whether a change was found in this element
type HeadersDiff ¶ added in v0.1.10
type HeadersDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedHeaders `json:"modified,omitempty" yaml:"modified,omitempty"` }
HeadersDiff is a diff between two sets of header objects: https://swagger.io/specification/#header-object
func (*HeadersDiff) Empty ¶ added in v0.2.10
func (headersDiff *HeadersDiff) Empty() bool
Empty indicates whether a change was found in this element
type InfoDiff ¶ added in v0.3.5
type InfoDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` TitleDiff *ValueDiff `json:"title,omitempty" yaml:"title,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` TermsOfServiceDiff *ValueDiff `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty"` ContactDiff *ContactDiff `json:"contact,omitempty" yaml:"contact,omitempty"` LicenseDiff *LicenseDiff `json:"license,omitempty" yaml:"license,omitempty"` VersionDiff *ValueDiff `json:"version,omitempty" yaml:"version,omitempty"` }
InfoDiff is the diff between two info objects: https://swagger.io/specification/#info-object
type LicenseDiff ¶ added in v0.3.5
type LicenseDiff struct { Added bool `json:"added,omitempty" yaml:"added,omitempty"` Deleted bool `json:"deleted,omitempty" yaml:"deleted,omitempty"` ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` NameDiff *ValueDiff `json:"name,omitempty" yaml:"name,omitempty"` URLDiff *ValueDiff `json:"url,omitempty" yaml:"url,omitempty"` }
LicenseDiff is the diff between two license objects: https://swagger.io/specification/#license-object
func (*LicenseDiff) Empty ¶ added in v0.3.5
func (diff *LicenseDiff) Empty() bool
Empty indicates whether a change was found in this element
type MethodDiff ¶
type MethodDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` TagsDiff *StringsDiff `json:"tags,omitempty" yaml:"tags,omitempty"` SummaryDiff *ValueDiff `json:"summary,omitempty" yaml:"summary,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` OperationIDDiff *ValueDiff `json:"operationID,omitempty" yaml:"operationID,omitempty"` ParametersDiff *ParametersDiff `json:"parameters,omitempty" yaml:"parameters,omitempty"` RequestBodyDiff *RequestBodyDiff `json:"requestBody,omitempty" yaml:"requestBody,omitempty"` ResponsesDiff *ResponsesDiff `json:"responses,omitempty" yaml:"responses,omitempty"` CallbacksDiff *CallbacksDiff `json:"callbacks,omitempty" yaml:"callbacks,omitempty"` DeprecatedDiff *ValueDiff `json:"deprecated,omitempty" yaml:"deprecated,omitempty"` SecurityDiff *SecurityRequirementsDiff `json:"securityRequirements,omitempty" yaml:"securityRequirements,omitempty"` ServersDiff *ServersDiff `json:"servers,omitempty" yaml:"servers,omitempty"` ExternalDocsDiff *ExternalDocsDiff `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"` }
MethodDiff is the diff between two operation objects: https://swagger.io/specification/#operation-object
func (*MethodDiff) Empty ¶ added in v0.2.10
func (methodDiff *MethodDiff) Empty() bool
Empty indicates whether a change was found in this element
type ModifiedCallbacks ¶ added in v0.1.11
ModifiedCallbacks is map of callback names to their respective diffs
type ModifiedEncodings ¶ added in v0.1.17
type ModifiedEncodings map[string]*EncodingDiff
ModifiedEncodings is map of enconding names to their respective diffs
type ModifiedExtensions ¶ added in v0.1.21
ModifiedExtensions is map of extensions names to their respective diffs
type ModifiedHeaders ¶ added in v0.1.10
type ModifiedHeaders map[string]*HeaderDiff
ModifiedHeaders is map of header names to their respective diffs
type ModifiedKeys ¶ added in v0.2.7
ModifiedKeys maps keys to their respective diffs
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 ModifiedRequestBodies ¶ added in v0.1.17
type ModifiedRequestBodies map[string]*RequestBodyDiff
ModifiedRequestBodies is map of requestBody names to their respective diffs
type ModifiedResponses ¶ added in v0.1.5
type ModifiedResponses map[string]*ResponseDiff
ModifiedResponses is map of response values to their respective diffs
type ModifiedSchemas ¶
type ModifiedSchemas map[string]*SchemaDiff
ModifiedSchemas is map of schema names to their respective diffs
type ModifiedSecuritySchemes ¶ added in v0.2.6
type ModifiedSecuritySchemes map[string]*SecuritySchemeDiff
ModifiedSecuritySchemes is map of security schemes to their respective diffs
type ModifiedServers ¶ added in v0.1.18
type ModifiedServers map[string]*ServerDiff
ModifiedServers is map of server names to their respective diffs
type ModifiedTags ¶ added in v0.1.11
ModifiedTags is map of tag names to their respective diffs
type OAuthFlowDiff ¶ added in v0.2.6
type OAuthFlowDiff struct { Added bool `json:"added,omitempty" yaml:"added,omitempty"` Deleted bool `json:"deleted,omitempty" yaml:"deleted,omitempty"` ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` AuthorizationURLDiff *ValueDiff `json:"authorizationURL,omitempty" yaml:"authorizationURL,omitempty"` TokenURLDiff *ValueDiff `json:"tokenURL,omitempty" yaml:"tokenURL,omitempty"` RefreshURLDiff *ValueDiff `json:"refresh,omitempty" yaml:"refresh,omitempty"` ScopesDiff *StringMapDiff `json:"scopes,omitempty" yaml:"scopes,omitempty"` }
OAuthFlowDiff is a diff between oauth flow objects: https://swagger.io/specification/#oauth-flow-object
func (*OAuthFlowDiff) Empty ¶ added in v0.2.10
func (diff *OAuthFlowDiff) Empty() bool
Empty indicates whether a change was found in this element
type OAuthFlowsDiff ¶ added in v0.2.6
type OAuthFlowsDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` ImplicitDiff *OAuthFlowDiff `json:"implicit,omitempty" yaml:"implicit,omitempty"` PasswordDiff *OAuthFlowDiff `json:"password,omitempty" yaml:"password,omitempty"` ClientCredentialsDiff *OAuthFlowDiff `json:"clientCredentials,omitempty" yaml:"clientCredentials,omitempty"` AuthorizationCodeDiff *OAuthFlowDiff `json:"authorizationCode,omitempty" yaml:"authorizationCode,omitempty"` }
OAuthFlowsDiff is a diff between oauth flows objects: https://swagger.io/specification/#oauth-flows-object
func (*OAuthFlowsDiff) Empty ¶ added in v0.2.10
func (diff *OAuthFlowsDiff) Empty() bool
Empty indicates whether a change was found in this element
type OperationsDiff ¶ added in v0.1.17
type OperationsDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedOperations `json:"modified,omitempty" yaml:"modified,omitempty"` }
OperationsDiff is a diff between the operation objects (https://swagger.io/specification/#operation-object) of two path item objects
func (*OperationsDiff) Empty ¶ added in v0.2.10
func (operationsDiff *OperationsDiff) Empty() bool
Empty indicates whether a change was found in this element
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]StringList
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 { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` StyleDiff *ValueDiff `json:"style,omitempty" yaml:"style,omitempty"` ExplodeDiff *ValueDiff `json:"explode,omitempty" yaml:"explode,omitempty"` AllowEmptyValueDiff *ValueDiff `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"` AllowReservedDiff *ValueDiff `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"` DeprecatedDiff *ValueDiff `json:"deprecated,omitempty" yaml:"deprecated,omitempty"` RequiredDiff *ValueDiff `json:"required,omitempty" yaml:"required,omitempty"` SchemaDiff *SchemaDiff `json:"schema,omitempty" yaml:"schema,omitempty"` ExampleDiff *ValueDiff `json:"example,omitempty" yaml:"example,omitempty"` // Examples ContentDiff *ContentDiff `json:"content,omitempty" yaml:"content,omitempty"` }
ParameterDiff is a diff between parameter objects: https://swagger.io/specification/#parameter-object
func (*ParameterDiff) Empty ¶ added in v0.2.10
func (diff *ParameterDiff) Empty() bool
Empty indicates whether a change was found in this element
type ParametersDiff ¶ added in v0.1.5
type ParametersDiff struct { Added ParamNamesByLocation `json:"added,omitempty" yaml:"added,omitempty"` Deleted ParamNamesByLocation `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ParamDiffByLocation `json:"modified,omitempty" yaml:"modified,omitempty"` }
ParametersDiff is a diff between two lists of parameter objects: https://swagger.io/specification/#parameter-object
func (*ParametersDiff) Empty ¶ added in v0.2.10
func (parametersDiff *ParametersDiff) Empty() bool
Empty indicates whether a change was found in this element
type PathDiff ¶
type PathDiff struct { SummaryDiff *ValueDiff `json:"summary,omitempty" yaml:"summary,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` OperationsDiff *OperationsDiff `json:"operations,omitempty" yaml:"operations,omitempty"` ServersDiff *ServersDiff `json:"servers,omitempty" yaml:"servers,omitempty"` ParametersDiff *ParametersDiff `json:"parameters,omitempty" yaml:"parameters,omitempty"` }
PathDiff is a diff between path item objects: https://swagger.io/specification/#path-item-object
type PathsDiff ¶ added in v0.1.5
type PathsDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedPaths `json:"modified,omitempty" yaml:"modified,omitempty"` }
PathsDiff is a diff between two sets of path item objects: https://swagger.io/specification/#path-item-object
type RequestBodiesDiff ¶ added in v0.1.14
type RequestBodiesDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedRequestBodies `json:"modified,omitempty" yaml:"modified,omitempty"` }
RequestBodiesDiff is a diff between two sets of request body objects: https://swagger.io/specification/#request-body-object
func (*RequestBodiesDiff) Empty ¶ added in v0.2.10
func (requestBodiesDiff *RequestBodiesDiff) Empty() bool
Empty indicates whether a change was found in this element
type RequestBodyDiff ¶ added in v0.1.14
type RequestBodyDiff struct { Added bool `json:"added,omitempty" yaml:"added,omitempty"` Deleted bool `json:"deleted,omitempty" yaml:"deleted,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` ContentDiff *ContentDiff `json:"content,omitempty" yaml:"content,omitempty"` }
RequestBodyDiff is a diff between request body objects: https://swagger.io/specification/#request-body-object
func (*RequestBodyDiff) Empty ¶ added in v0.2.10
func (requestBodyDiff *RequestBodyDiff) Empty() bool
Empty indicates whether a change was found in this element
type ResponseDiff ¶ added in v0.1.5
type ResponseDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` HeadersDiff *HeadersDiff `json:"headers,omitempty" yaml:"headers,omitempty"` ContentDiff *ContentDiff `json:"content,omitempty" yaml:"content,omitempty"` }
ResponseDiff is a diff between response objects: https://swagger.io/specification/#response-object
func (*ResponseDiff) Empty ¶ added in v0.2.10
func (diff *ResponseDiff) Empty() bool
Empty indicates whether a change was found in this element
type ResponsesDiff ¶ added in v0.1.5
type ResponsesDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedResponses `json:"modified,omitempty" yaml:"modified,omitempty"` }
ResponsesDiff is a diff between two sets of response objects: https://swagger.io/specification/#responses-object
func (*ResponsesDiff) Empty ¶ added in v0.2.10
func (responsesDiff *ResponsesDiff) Empty() bool
Empty indicates whether a change was found in this element
type SchemaDiff ¶
type SchemaDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` SchemaAdded bool `json:"schemaAdded,omitempty" yaml:"schemaAdded,omitempty"` SchemaDeleted bool `json:"schemaDeleted,omitempty" yaml:"schemaDeleted,omitempty"` ValueAdded bool `json:"valueAdded,omitempty" yaml:"valueAdded,omitempty"` ValueDeleted bool `json:"valueDeleted,omitempty" yaml:"valueDeleted,omitempty"` OneOfDiff bool `json:"oneOf,omitempty" yaml:"oneOf,omitempty"` AnyOfDiff bool `json:"anyOf,omitempty" yaml:"anyOf,omitempty"` AllOfDiff bool `json:"allOf,omitempty" yaml:"allOf,omitempty"` NotDiff *SchemaDiff `json:"not,omitempty" yaml:"not,omitempty"` TypeDiff *ValueDiff `json:"type,omitempty" yaml:"type,omitempty"` TitleDiff *ValueDiff `json:"title,omitempty" yaml:"title,omitempty"` FormatDiff *ValueDiff `json:"format,omitempty" yaml:"format,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` EnumDiff *EnumDiff `json:"enum,omitempty" yaml:"enum,omitempty"` DefaultDiff *ValueDiff `json:"default,omitempty" yaml:"default,omitempty"` ExampleDiff *ValueDiff `json:"example,omitempty" yaml:"example,omitempty"` ExternalDocsDiff *ExternalDocsDiff `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"` AdditionalPropertiesAllowedDiff *ValueDiff `json:"additionalPropertiesAllowed,omitempty" yaml:"additionalPropertiesAllowed,omitempty"` UniqueItemsDiff *ValueDiff `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"` ExclusiveMinDiff *ValueDiff `json:"exclusiveMin,omitempty" yaml:"exclusiveMin,omitempty"` ExclusiveMaxDiff *ValueDiff `json:"exclusiveMax,omitempty" yaml:"exclusiveMax,omitempty"` NullableDiff *ValueDiff `json:"nullable,omitempty" yaml:"nullable,omitempty"` ReadOnlyDiff *ValueDiff `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` WriteOnlyDiff *ValueDiff `json:"writeOnly,omitempty" yaml:"writeOnly,omitempty"` AllowEmptyValueDiff *ValueDiff `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"` XMLDiff *ValueDiff `json:"XML,omitempty" yaml:"XML,omitempty"` DeprecatedDiff *ValueDiff `json:"deprecated,omitempty" yaml:"deprecated,omitempty"` MinDiff *ValueDiff `json:"min,omitempty" yaml:"min,omitempty"` MaxDiff *ValueDiff `json:"max,omitempty" yaml:"max,omitempty"` MultipleOf *ValueDiff `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"` MinLength *ValueDiff `json:"minLength,omitempty" yaml:"minLength,omitempty"` MaxLength *ValueDiff `json:"maxLength,omitempty" yaml:"maxLength,omitempty"` Pattern *ValueDiff `json:"pattern,omitempty" yaml:"pattern,omitempty"` MinItems *ValueDiff `json:"minItems,omitempty" yaml:"minItems,omitempty"` MaxItems *ValueDiff `json:"maxItems,omitempty" yaml:"maxItems,omitempty"` Items *SchemaDiff `json:"items,omitempty" yaml:"items,omitempty"` Required *StringsDiff `json:"required,omitempty" yaml:"required,omitempty"` PropertiesDiff *SchemasDiff `json:"properties,omitempty" yaml:"properties,omitempty"` MinProps *ValueDiff `json:"minProps,omitempty" yaml:"minProps,omitempty"` MaxProps *ValueDiff `json:"maxProps,omitempty" yaml:"maxProps,omitempty"` AdditionalProperties *SchemaDiff `json:"additionalProperties,omitempty" yaml:"additionalProperties,omitempty"` }
SchemaDiff is a diff between schema objects: https://swagger.io/specification/#schema-object. Boolean fields specify whether the property in question was changed between the two versions. Pointer fields specify not only the presence of a change but also the old and new values of the property.
func (*SchemaDiff) Empty ¶ added in v0.2.10
func (diff *SchemaDiff) Empty() bool
Empty indicates whether a change was found in this element
type SchemasDiff ¶ added in v0.1.5
type SchemasDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedSchemas `json:"modified,omitempty" yaml:"modified,omitempty"` }
SchemasDiff is a diff between two sets of schema objects: https://swagger.io/specification/#schema-object
func (*SchemasDiff) Empty ¶ added in v0.2.10
func (schemasDiff *SchemasDiff) Empty() bool
Empty indicates whether a change was found in this element
type SecurityRequirementsDiff ¶ added in v0.2.9
type SecurityRequirementsDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` }
SecurityRequirementsDiff is a diff between two sets of security requirement objects: https://swagger.io/specification/#security-requirement-object
func (*SecurityRequirementsDiff) Empty ¶ added in v0.2.10
func (diff *SecurityRequirementsDiff) Empty() bool
Empty indicates whether a change was found in this element
type SecuritySchemeDiff ¶ added in v0.2.6
type SecuritySchemeDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` TypeDiff *ValueDiff `json:"type,omitempty" yaml:"type,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` NameDiff *ValueDiff `json:"name,omitempty" yaml:"name,omitempty"` InDiff *ValueDiff `json:"in,omitempty" yaml:"in,omitempty"` SchemeDiff *ValueDiff `json:"scheme,omitempty" yaml:"scheme,omitempty"` BearerFormatDiff *ValueDiff `json:"bearerFormat,omitempty" yaml:"bearerFormat,omitempty"` OAuthFlowsDiff *OAuthFlowsDiff `json:"OAuthFlows,omitempty" yaml:"OAuthFlows,omitempty"` OpenIDConnectURLDiff *ValueDiff `json:"openIDConnectURL,omitempty" yaml:"openIDConnectURL,omitempty"` }
SecuritySchemeDiff is a diff between security scheme objects: https://swagger.io/specification/#security-scheme-object
func (*SecuritySchemeDiff) Empty ¶ added in v0.2.10
func (diff *SecuritySchemeDiff) Empty() bool
Empty indicates whether a change was found in this element
type SecuritySchemesDiff ¶ added in v0.2.6
type SecuritySchemesDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedSecuritySchemes `json:"modified,omitempty" yaml:"modified,omitempty"` }
SecuritySchemesDiff is a diff between two sets of security scheme objects: https://swagger.io/specification/#security-scheme-object
func (*SecuritySchemesDiff) Empty ¶ added in v0.2.10
func (diff *SecuritySchemesDiff) Empty() bool
Empty indicates whether a change was found in this element
type ServerDiff ¶ added in v0.1.18
type ServerDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` URLDiff *ValueDiff `json:"urlType,omitempty" yaml:"urlType,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` }
ServerDiff is a diff between server objects: https://swagger.io/specification/#server-object
func (*ServerDiff) Empty ¶ added in v0.2.10
func (diff *ServerDiff) Empty() bool
Empty indicates whether a change was found in this element
type ServersDiff ¶ added in v0.1.18
type ServersDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedServers `json:"modified,omitempty" yaml:"modified,omitempty"` }
ServersDiff is a diff between two sets of encoding objects: https://swagger.io/specification/#server-object
func (*ServersDiff) Empty ¶ added in v0.2.10
func (diff *ServersDiff) Empty() bool
Empty indicates whether a change was found in this element
type SpecDiff ¶ added in v0.1.9
type SpecDiff struct { ExtensionsDiff *ExtensionsDiff `json:"extensions,omitempty" yaml:"extensions,omitempty"` OpenAPIDiff *ValueDiff `json:"openAPI,omitempty" yaml:"openAPI,omitempty"` InfoDiff *InfoDiff `json:"info,omitempty" yaml:"info,omitempty"` PathsDiff *PathsDiff `json:"paths,omitempty" yaml:"paths,omitempty"` SecurityDiff *SecurityRequirementsDiff `json:"security,omitempty" yaml:"security,omitempty"` ServersDiff *ServersDiff `json:"servers,omitempty" yaml:"servers,omitempty"` TagsDiff *TagsDiff `json:"tags,omitempty" yaml:"tags,omitempty"` ExternalDocsDiff *ExternalDocsDiff `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"` ComponentsDiff `json:"components,omitempty" yaml:"components,omitempty"` }
SpecDiff describes the changes between two OpenAPI specifications: https://swagger.io/specification/#schema
type StringMapDiff ¶ added in v0.2.7
type StringMapDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedKeys `json:"modified,omitempty" yaml:"modified,omitempty"` }
StringMapDiff is the diff between two string maps
func (*StringMapDiff) Empty ¶ added in v0.2.10
func (diff *StringMapDiff) Empty() bool
Empty indicates whether a change was found in this element
type StringSet ¶ added in v0.1.11
type StringSet map[string]struct{}
StringSet is a set of string values
type StringsDiff ¶ added in v0.1.11
type StringsDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` }
StringsDiff is the diff between two lists of strings
func (*StringsDiff) Empty ¶ added in v0.2.10
func (stringsDiff *StringsDiff) Empty() bool
Empty indicates whether a change was found in this element
type Summary ¶ added in v0.0.9
type Summary struct { Diff bool `json:"diff" yaml:"diff"` Details map[DetailName]*SummaryDetails `json:"details,omitempty" yaml:"details,omitempty"` }
Summary summarizes the changes between two OpenAPI specifications
func (*Summary) GetSummaryDetails ¶ added in v0.1.13
func (summary *Summary) GetSummaryDetails(name DetailName) SummaryDetails
GetSummaryDetails returns the summary for a specific part
type SummaryDetails ¶ added in v0.1.8
type SummaryDetails struct { Added int `json:"added,omitempty" yaml:"added,omitempty"` // number of added items Deleted int `json:"deleted,omitempty" yaml:"deleted,omitempty"` // number of deleted items Modified int `json:"modified,omitempty" yaml:"modified,omitempty"` // number of modified items }
SummaryDetails summarizes the changes between equivalent parts of the two OpenAPI specifications: paths, schemas, parameters, headers, responses etc.
type TagDiff ¶ added in v0.1.11
type TagDiff struct { NameDiff *ValueDiff `json:"name,omitempty" yaml:"name,omitempty"` DescriptionDiff *ValueDiff `json:"description,omitempty" yaml:"description,omitempty"` }
TagDiff is a diff between tag objects: https://swagger.io/specification/#tag-object
type TagsDiff ¶ added in v0.1.11
type TagsDiff struct { Added StringList `json:"added,omitempty" yaml:"added,omitempty"` Deleted StringList `json:"deleted,omitempty" yaml:"deleted,omitempty"` Modified ModifiedTags `json:"modified,omitempty" yaml:"modified,omitempty"` }
TagsDiff is a diff between two lists of tag objects: https://swagger.io/specification/#tag-object
Source Files
¶
- callbacks_diff.go
- components_diff.go
- config.go
- contact.go
- content_diff.go
- diff.go
- diff_endpoints.go
- doc.go
- encoding_diff.go
- encodings_diff.go
- enum_diff.go
- extensions_diff.go
- external_docs_diff.go
- header_diff.go
- headers_diff.go
- info_diff.go
- license.go
- method_diff.go
- modified_paths.go
- modified_schemas.go
- oauth_flow.go
- oauth_flows.go
- operations_diff.go
- parameter_diff.go
- parameters_aux.go
- parameters_diff.go
- path_diff.go
- paths_diff.go
- request_bodies_diff.go
- request_body_diff.go
- response_diff.go
- responses_diff.go
- schema_diff.go
- schemas_diff.go
- security_requirements_diff.go
- security_scheme.go
- security_schemes.go
- server_diff.go
- servers_diff.go
- spec_diff.go
- string_list.go
- string_list_diff.go
- string_map.go
- string_map_diff.go
- string_set.go
- summary.go
- tag_diff.go
- tags_diff.go
- value_diff.go