what_changed

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package what_changed determines what changed between two AsyncAPI documents.

The package compares the low-level models of two parsed documents and produces a hierarchical tree of changes — additions, removals and modifications — each classified as breaking or non-breaking with full YAML line and column context. Breaking classification is driven by a configurable, AsyncAPI shaped rules system in the model sub-package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareAsyncAPIDocuments

func CompareAsyncAPIDocuments(original, updated *lowasync.AsyncAPI) *model.DocumentChanges

CompareAsyncAPIDocuments compares two low-level AsyncAPI documents and returns a pointer to model.DocumentChanges describing everything that changed, or nil if nothing changed.

func CompareAsyncAPIDocumentsWithConfig

func CompareAsyncAPIDocumentsWithConfig(original, updated *lowasync.AsyncAPI,
	config *model.BreakingRulesConfig,
) *model.DocumentChanges

CompareAsyncAPIDocumentsWithConfig compares two low-level AsyncAPI documents using config for this call only. Pass nil to use the default breaking rules.

func CompareDocuments

func CompareDocuments(original, updated libasyncapi.Document) *model.DocumentChanges

CompareDocuments compares two parsed AsyncAPI documents and returns a pointer to model.DocumentChanges describing everything that changed, or nil if nothing changed.

func CompareDocumentsWithConfig

func CompareDocumentsWithConfig(original, updated libasyncapi.Document,
	config *model.BreakingRulesConfig,
) *model.DocumentChanges

CompareDocumentsWithConfig compares two parsed AsyncAPI documents using config for this call only. Pass nil to use the default breaking rules.

Types

type Changed

type Changed interface {
	// GetAllChanges returns all top level changes made to properties in this object,
	// including all children.
	GetAllChanges() []*model.Change

	// TotalChanges returns a count of all changes made on the object, including all children.
	TotalChanges() int

	// TotalBreakingChanges returns a count of all breaking changes on this object,
	// including all children.
	TotalBreakingChanges() int
}

Changed represents an object that was changed.

Directories

Path Synopsis
Package model contains all the comparison logic and change types used to determine what changed between two AsyncAPI documents.
Package model contains all the comparison logic and change types used to determine what changed between two AsyncAPI documents.
Package reports provides summarized, flattened views over the hierarchical change trees produced by the what-changed model.
Package reports provides summarized, flattened views over the hierarchical change trees produced by the what-changed model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL