@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44
55## Project Overview
66
7- Go library for analyzing, flattening, merging (mixin), and fixing
7+ Go library for analyzing, diffing, flattening, merging (mixin), and fixing
88[ Swagger 2.0] ( https://swagger.io/specification/v2/ ) specifications. Built on top of
99` go-openapi/spec ` , it is a central utility in the go-swagger ecosystem for code generation
1010and validation tooling.
@@ -28,6 +28,17 @@ See [docs/MAINTAINERS.md](../docs/MAINTAINERS.md) for CI/CD, release process, an
2828| ` errors.go ` | Sentinel errors (` ErrAnalysis ` , ` ErrNoSchema ` ) and error factory functions |
2929| ` debug.go ` | Debug logger wired to ` SWAGGER_DEBUG ` env var |
3030
31+ ### ` diff/ ` package
32+
33+ | File | Contents |
34+ | ------| ----------|
35+ | ` diff/spec_analyser.go ` | ` SpecAnalyser ` — walks two specs and collects differences by endpoint, schema, parameter, response |
36+ | ` diff/reporting.go ` | ` Compare(spec1, spec2 *spec.Swagger) ` — top-level entry point returning ` SpecDifferences ` |
37+ | ` diff/compatibility.go ` | Backward-compatibility classification of each change |
38+ | ` diff/spec_difference.go ` | ` SpecDifference ` , ` SpecDifferences ` , ` SpecChangeCode ` — diff result types |
39+ | ` diff/schema.go ` | Schema-level diffing (properties, enums, allOf) |
40+ | ` diff/checks.go ` | Primitive comparisons: ` CompareEnums() ` , ` CompareProperties() ` , numeric range checks |
41+
3142### Internal packages (` internal/ ` )
3243
3344| Package | Contents |
@@ -47,6 +58,7 @@ See [docs/MAINTAINERS.md](../docs/MAINTAINERS.md) for CI/CD, release process, an
4758- ` Schema(SchemaOpts) (*AnalyzedSchema, error) ` — classify a schema (array, map, tuple, base type, etc.)
4859- ` Flatten(FlattenOpts) error ` — flatten/expand a spec (inline schemas → definitions, remote refs → local)
4960- ` Mixin(primary, mixins...) []string ` — merge multiple specs, returning collision warnings
61+ - ` diff.Compare(spec1, spec2 *spec.Swagger) (SpecDifferences, error) ` — compare two specs and report changes with compatibility info
5062- ` FixEmptyResponseDescriptions(*spec.Swagger) ` — patch empty response descriptions
5163
5264### Dependencies
0 commit comments