mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
Clearing up some dead code and adding docs to what-changed
Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
@@ -8,12 +8,14 @@ import (
|
||||
"github.com/pb33f/libopenapi/datamodel/low/v3"
|
||||
)
|
||||
|
||||
// CallbackChanges represents all changes made between two Callback OpenAPI objects.
|
||||
type CallbackChanges struct {
|
||||
PropertyChanges
|
||||
ExpressionChanges map[string]*PathItemChanges `json:"expressions,omitempty" yaml:"expressions,omitempty"`
|
||||
ExtensionChanges *ExtensionChanges `json:"extensions,omitempty" yaml:"extensions,omitempty"`
|
||||
}
|
||||
|
||||
// TotalChanges returns a total count of all changes made between Callback objects
|
||||
func (c *CallbackChanges) TotalChanges() int {
|
||||
d := c.PropertyChanges.TotalChanges()
|
||||
for k := range c.ExpressionChanges {
|
||||
@@ -25,6 +27,7 @@ func (c *CallbackChanges) TotalChanges() int {
|
||||
return d
|
||||
}
|
||||
|
||||
// TotalBreakingChanges returns a total count of all changes made between Callback objects
|
||||
func (c *CallbackChanges) TotalBreakingChanges() int {
|
||||
d := c.PropertyChanges.TotalBreakingChanges()
|
||||
for k := range c.ExpressionChanges {
|
||||
@@ -36,6 +39,8 @@ func (c *CallbackChanges) TotalBreakingChanges() int {
|
||||
return d
|
||||
}
|
||||
|
||||
// CompareCallback will compare two Callback objects and return a pointer to CallbackChanges with all the things
|
||||
// that have changed between them.
|
||||
func CompareCallback(l, r *v3.Callback) *CallbackChanges {
|
||||
|
||||
cc := new(CallbackChanges)
|
||||
|
||||
Reference in New Issue
Block a user