Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct {
Kind ChangeKind
Location string
From string
To string
Severity Severity
Note string
Target Target
// FromRequired/ToRequired carry required-membership across a rename — the
// old/new names differ, so patch can't infer this from properties alone.
FromRequired bool
ToRequired bool
}
type ChangeKind ¶
type ChangeKind string
const ( OperationAdded ChangeKind = "operation_added" OperationRemoved ChangeKind = "operation_removed" ParameterAdded ChangeKind = "parameter_added" ParameterRemoved ChangeKind = "parameter_removed" ParameterTypeChanged ChangeKind = "parameter_type_changed" ParameterRequiredChanged ChangeKind = "parameter_required_changed" ResponseAdded ChangeKind = "response_added" // status code ResponseRemoved ChangeKind = "response_removed" SchemaAdded ChangeKind = "schema_added" SchemaRemoved ChangeKind = "schema_removed" PropertyAdded ChangeKind = "property_added" PropertyRemoved ChangeKind = "property_removed" PropertyTypeChanged ChangeKind = "property_type_changed" PropertyRenamed ChangeKind = "property_renamed" RequiredAdded ChangeKind = "required_added" RequiredRemoved ChangeKind = "required_removed" // RequiredDangling flags a `required` entry naming no property in the same // schema — a self-consistency lint on ONE document (not a/b drift), so it's // informational only and patch deliberately has no case for it: there's no // code-side value to pull from for a name that doesn't exist as a property. RequiredDangling ChangeKind = "required_dangling" )
type Direction ¶
type Direction int
Direction is where a schema sits on the contract: client->server or server->client.
type Report ¶
type Report struct{ Changes []Change }
func Diff ¶
Diff compares two CANONICAL documents (a=published, b=code). Detection is symmetric; direction only affects how severe a found change is.
type Target ¶
type Target struct {
// schema-property changes
Schema string
Direction Direction
Property string
// operation / parameter / response changes
Method string
Path string
ParamName string
ParamIn string
StatusCode string
}
Target is the machine-addressable location of a change, so downstream (patch) never parses the human-readable Location string. Fields are populated per change kind; unused ones stay zero.
Click to show internal directories.
Click to hide internal directories.