Versions in this module Expand all Collapse all v0 v0.31.0 Apr 9, 2024 v0.30.0 Mar 28, 2022 Changes in this version + const StringType + var ArrayType = "array" + var ObjectType = "object" + func JSONMarshal(t interface{}) ([]byte, error) + type CompareSchemaFn func(location DifferenceLocation, schema1, schema2 *spec.Schema) + type Compatibility int + const Breaking + const NonBreaking + func (s *Compatibility) UnmarshalJSON(b []byte) error + func (s Compatibility) MarshalJSON() ([]byte, error) + func (s Compatibility) String() string + type CompatibilityPolicy struct + ForChange map[SpecChangeCode]Compatibility + ForRequest map[SpecChangeCode]Compatibility + ForResponse map[SpecChangeCode]Compatibility + type DataDirection int + const Request + const Response + type DifferenceLocation struct + Method string + Node *Node + Response int + URL string + func (dl DifferenceLocation) AddNode(node *Node) DifferenceLocation + type Node struct + ChildNode *Node + Field string + IsArray bool + TypeName string + func (n *Node) AddLeafNode(toAdd *Node) *Node + func (n *Node) String() string + func (n Node) Copy() *Node + type OperationMap map[string]*spec.Operation + type Pair struct + First interface{} + Second interface{} + type PathItemOp struct + Operation *spec.Operation + ParentPathItem *spec.PathItem + type PropertyDefn struct + Required bool + Schema *spec.Schema + type PropertyMap map[string]PropertyDefn + type SchemaFromRefFn func(spec.Ref) (*spec.Schema, string) + type SpecAnalyser struct + Definitions1 spec.Definitions + Definitions2 spec.Definitions + Diffs SpecDifferences + ReferencedDefinitions map[string]bool + func NewSpecAnalyser() *SpecAnalyser + func (sd *SpecAnalyser) Analyse(spec1, spec2 *spec.Swagger) error + func (sd *SpecAnalyser) AnalyseDefinitions() + func (sd *SpecAnalyser) CompareProps(type1, type2 *spec.SchemaProps) []TypeDiff + type SpecChangeCode int + const AddedConstraint + const AddedConsumesFormat + const AddedDefinition + const AddedDescripton + const AddedEndpoint + const AddedEnumValue + const AddedOptionalParam + const AddedProducesFormat + const AddedProperty + const AddedRequiredParam + const AddedRequiredProperty + const AddedResponse + const AddedResponseHeader + const AddedSchemes + const AddedTag + const ChangedBasePath + const ChangedDescripton + const ChangedHostURL + const ChangedOptionalToRequired + const ChangedRequiredToOptional + const ChangedResponseHeader + const ChangedTag + const ChangedToCompatibleType + const ChangedType + const DeletedConstraint + const DeletedConsumesFormat + const DeletedDefinition + const DeletedDeprecatedEndpoint + const DeletedDescripton + const DeletedEndpoint + const DeletedEnumValue + const DeletedOptionalParam + const DeletedProducesFormat + const DeletedProperty + const DeletedRequiredParam + const DeletedResponse + const DeletedResponseHeader + const DeletedSchemes + const DeletedTag + const NarrowedType + const NoChangeDetected + const RefTargetChanged + const RefTargetRenamed + const WidenedType + func (s *SpecChangeCode) UnmarshalJSON(b []byte) error + func (s SpecChangeCode) Description() (result string) + func (s SpecChangeCode) MarshalJSON() ([]byte, error) + type SpecDifference struct + Code SpecChangeCode + Compatibility Compatibility + DiffInfo string + DifferenceLocation DifferenceLocation + func CompareProperties(location DifferenceLocation, schema1 *spec.Schema, schema2 *spec.Schema, ...) []SpecDifference + func (sd SpecDifference) Matches(other SpecDifference) bool + func (sd SpecDifference) String() string + type SpecDifferences []SpecDifference + func Compare(spec1, spec2 *spec.Swagger) (diffs SpecDifferences, err error) + func (sd *SpecDifferences) ReportCompatibility() (io.Reader, error, error) + func (sd SpecDifferences) BreakingChangeCount() int + func (sd SpecDifferences) Contains(diff SpecDifference) bool + func (sd SpecDifferences) FilterIgnores(ignores SpecDifferences) SpecDifferences + func (sd SpecDifferences) ReportAllDiffs(fmtJSON bool) (io.Reader, error, error) + type TypeDiff struct + Change SpecChangeCode + Description string + FromType string + ToType string + func CheckRefChange(diffs []TypeDiff, type1, type2 interface{}) (diffReturn []TypeDiff) + func CheckStringTypeChanges(diffs []TypeDiff, type1, type2 *spec.SchemaProps) []TypeDiff + func CheckToFromPrimitiveType(diffs []TypeDiff, type1, type2 interface{}) []TypeDiff + func CheckToFromRequired(required1, required2 bool) (diffs []TypeDiff) + func CompareEnums(left, right []interface{}) []TypeDiff + func CompareFloatValues(fieldName string, val1 *float64, val2 *float64, ifGreaterCode SpecChangeCode, ...) []TypeDiff + func CompareIntValues(fieldName string, val1 *int64, val2 *int64, ifGreaterCode SpecChangeCode, ...) []TypeDiff + type URLMethod struct + Method string + Path string + func (p URLMethod) MarshalText() (text []byte, err error) + type URLMethodResponse struct + Method string + Path string + Response string + type URLMethods map[URLMethod]*PathItemOp