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 EndpointDiff
- type EnumDiff
- type MethodDiff
- type ModifiedEndpoints
- type ModifiedOperations
- type ModifiedSchemas
- type OperationList
- type Operations
- type ParamDiff
- type ParamDiffs
- type ParamNames
- type Params
- type PathDiff
- type PathSummary
- type Result
- type SchemaCollectionDiff
- type SchemaDiff
- type SchemaSummary
- 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"` }
type Diff ¶
type Diff struct { PathDiff *PathDiff `json:"endpoints,omitempty"` SchemaDiff *SchemaCollectionDiff `json:"schemas,omitempty"` }
type EndpointDiff ¶
type EndpointDiff struct {
Operations `json:"operations,omitempty"`
}
type EnumDiff ¶ added in v0.1.3
type EnumDiff struct { Added []interface{} `json:"added,omitempty"` Deleted []interface{} `json:"deleted,omitempty"` }
type MethodDiff ¶
type MethodDiff struct {
Params `json:"parameters,omitempty"`
}
type ModifiedEndpoints ¶
type ModifiedEndpoints map[string]*EndpointDiff // key is endpoint (path)
type ModifiedOperations ¶
type ModifiedOperations map[string]*MethodDiff // key is HTTP method
type ModifiedSchemas ¶
type ModifiedSchemas map[string]*SchemaDiff
type OperationList ¶ added in v0.0.9
type OperationList []string
type Operations ¶ added in v0.0.9
type Operations struct { AddedOperations OperationList `json:"added,omitempty"` DeletedOperations OperationList `json:"deleted,omitempty"` ModifiedOperations ModifiedOperations `json:"modified,omitempty"` }
type ParamDiff ¶
type ParamDiff 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"` }
type ParamDiffs ¶
type ParamNames ¶
type ParamNames map[string]struct{} // key is param name
type Params ¶ added in v0.0.9
type Params struct { AddedParams map[string]ParamNames `json:"added,omitempty"` // key is param location (path, query, header or cookie) DeletedParams map[string]ParamNames `json:"deleted,omitempty"` // key is param location ModifiedParams map[string]ParamDiffs `json:"modified,omitempty"` // key is param location }
type PathDiff ¶
type PathDiff struct { AddedEndpoints []string `json:"added,omitempty"` DeletedEndpoints []string `json:"deleted,omitempty"` ModifiedEndpoints ModifiedEndpoints `json:"modified,omitempty"` }
type PathSummary ¶ added in v0.0.9
type Result ¶ added in v0.0.9
type Result struct { Diff *Diff `json:"diff,omitempty"` Summary *Summary `json:"summary,omitempty"` }
type SchemaCollectionDiff ¶
type SchemaCollectionDiff struct { AddedSchemas []string `json:"added,omitempty"` DeletedSchemas []string `json:"deleted,omitempty"` ModifiedSchemas ModifiedSchemas `json:"modified,omitempty"` }
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"` }
type SchemaSummary ¶ added in v0.0.9
type Summary ¶ added in v0.0.9
type Summary struct { Diff bool `json:"diff"` PathSummary *PathSummary `json:"endpoints,omitempty"` SchemaSummary *SchemaSummary `json:"schemas,omitempty"` }
Click to show internal directories.
Click to hide internal directories.