diff --git a/src/change.rs b/src/change.rs index e29b3cf..d8b0974 100644 --- a/src/change.rs +++ b/src/change.rs @@ -1,9 +1,10 @@ -// Copyright 2025 Oxide Computer Company +// Copyright 2026 Oxide Computer Company + +use std::fmt; use crate::JsonPathStack; // Describes any change detected between two OpenAPI documents. -#[derive(Debug)] pub struct Change { /// Human-readable message describing the nature of the change. pub message: String, @@ -18,10 +19,71 @@ pub struct Change { /// Classification of the change compatibility. pub class: ChangeClass, - /// Details on the kind of change + /// Details on the kind of change. pub details: ChangeDetails, } +// Format `Change` in the nested `paths`/`changes` layout that will be +// introduced when the type is restructured into `Change`, `ChangePath`, and +// `ChangeInfo`. Doing this ahead of time keeps the restructuring commit free +// of test-output noise. +impl fmt::Debug for Change { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + /// Wrapper that formats as `ChangePath { old, new, comparison }`. + struct PathFmt<'a> { + old: &'a JsonPathStack, + new: &'a JsonPathStack, + comparison: &'a ChangeComparison, + } + + impl fmt::Debug for PathFmt<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ChangePath") + .field("old", self.old) + .field("new", self.new) + .field("comparison", self.comparison) + .finish() + } + } + + /// Wrapper that formats as `ChangeInfo { old_subpath, new_subpath, + /// message, class, details }`. + struct InfoFmt<'a> { + message: &'a str, + class: &'a ChangeClass, + details: &'a ChangeDetails, + } + + impl fmt::Debug for InfoFmt<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ChangeInfo") + .field("old_subpath", &"") + .field("new_subpath", &"") + .field("message", &self.message) + .field("class", self.class) + .field("details", self.details) + .finish() + } + } + + let path = PathFmt { + old: &self.old_path, + new: &self.new_path, + comparison: &self.comparison, + }; + let info = InfoFmt { + message: &self.message, + class: &self.class, + details: &self.details, + }; + + f.debug_struct("Change") + .field("paths", &[path]) + .field("changes", &[info]) + .finish() + } +} + impl Change { pub fn new( message: impl ToString, diff --git a/tests/cases/cycle-detection/output/add-property-to-mutual-recursion.out b/tests/cases/cycle-detection/output/add-property-to-mutual-recursion.out index b200b61..dd4bf4c 100644 --- a/tests/cases/cycle-detection/output/add-property-to-mutual-recursion.out +++ b/tests/cases/cycle-detection/output/add-property-to-mutual-recursion.out @@ -15,19 +15,29 @@ Result for patch: [ Change { - message: "object properties changed", - old_path: [ - "#/components/schemas/Person", - "#/components/schemas/Company/properties/ceo/$ref", - "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/Person", + "#/components/schemas/Company/properties/ceo/$ref", + "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/Person", + "#/components/schemas/Company/properties/ceo/$ref", + "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/Person", - "#/components/schemas/Company/properties/ceo/$ref", - "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/cycle-detection/output/asymmetric-unroll-with-property-change.out b/tests/cases/cycle-detection/output/asymmetric-unroll-with-property-change.out index 11ebd94..7261d8a 100644 --- a/tests/cases/cycle-detection/output/asymmetric-unroll-with-property-change.out +++ b/tests/cases/cycle-detection/output/asymmetric-unroll-with-property-change.out @@ -34,49 +34,79 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/DirectLoop", - "#/components/schemas/DirectLoop/properties/next/$ref", - "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/DirectLoop", + "#/components/schemas/DirectLoop/properties/next/$ref", + "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/LoopIndirect", + "#/components/schemas/DirectLoop/properties/next/$ref", + "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/LoopIndirect", - "#/components/schemas/DirectLoop/properties/next/$ref", - "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, Change { - message: "object properties changed", - old_path: [ - "#/components/schemas/DirectLoop", - "#/components/schemas/DirectLoop/properties/next/$ref", - "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/DirectLoop", + "#/components/schemas/DirectLoop/properties/next/$ref", + "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/LoopIndirect", + "#/components/schemas/DirectLoop/properties/next/$ref", + "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/LoopIndirect", - "#/components/schemas/DirectLoop/properties/next/$ref", - "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/DirectLoop/properties/value", - "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/DirectLoop/properties/value", + "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/DirectLoop/properties/value", + "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/DirectLoop/properties/value", - "#/paths/~1direct-loop/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/cycle-detection/output/change-item-value-type.out b/tests/cases/cycle-detection/output/change-item-value-type.out index b7f0017..da50f5d 100644 --- a/tests/cases/cycle-detection/output/change-item-value-type.out +++ b/tests/cases/cycle-detection/output/change-item-value-type.out @@ -14,19 +14,29 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/Item/properties/value", - "#/components/schemas/ItemPage/properties/items/items/$ref", - "#/paths/~1items/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/Item/properties/value", + "#/components/schemas/ItemPage/properties/items/items/$ref", + "#/paths/~1items/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/Item/properties/value", + "#/components/schemas/ItemPage/properties/items/items/$ref", + "#/paths/~1items/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/Item/properties/value", - "#/components/schemas/ItemPage/properties/items/items/$ref", - "#/paths/~1items/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/cycle-detection/output/change-mutual-recursion-property.out b/tests/cases/cycle-detection/output/change-mutual-recursion-property.out index 6bd6c9d..8466bc7 100644 --- a/tests/cases/cycle-detection/output/change-mutual-recursion-property.out +++ b/tests/cases/cycle-detection/output/change-mutual-recursion-property.out @@ -14,19 +14,29 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/Person/properties/name", - "#/components/schemas/Company/properties/ceo/$ref", - "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/Person/properties/name", + "#/components/schemas/Company/properties/ceo/$ref", + "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/Person/properties/name", + "#/components/schemas/Company/properties/ceo/$ref", + "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/Person/properties/name", - "#/components/schemas/Company/properties/ceo/$ref", - "#/paths/~1companies/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/cycle-detection/output/change-three-cycle-property.out b/tests/cases/cycle-detection/output/change-three-cycle-property.out index 1dc673e..3c0d33b 100644 --- a/tests/cases/cycle-detection/output/change-three-cycle-property.out +++ b/tests/cases/cycle-detection/output/change-three-cycle-property.out @@ -14,19 +14,29 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/NodeB/properties/label", - "#/components/schemas/NodeA/properties/next/$ref", - "#/paths/~1three-cycle/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/NodeB/properties/label", + "#/components/schemas/NodeA/properties/next/$ref", + "#/paths/~1three-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/NodeB/properties/label", + "#/components/schemas/NodeA/properties/next/$ref", + "#/paths/~1three-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/NodeB/properties/label", - "#/components/schemas/NodeA/properties/next/$ref", - "#/paths/~1three-cycle/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/cycle-detection/output/change-wrapped-cycle-property.out b/tests/cases/cycle-detection/output/change-wrapped-cycle-property.out index 4c9bafe..cd3bea5 100644 --- a/tests/cases/cycle-detection/output/change-wrapped-cycle-property.out +++ b/tests/cases/cycle-detection/output/change-wrapped-cycle-property.out @@ -14,19 +14,29 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/Wrapped/properties/value", - "#/components/schemas/Wrapper/properties/child/0/$ref", - "#/paths/~1wrapped-cycle/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/Wrapped/properties/value", + "#/components/schemas/Wrapper/properties/child/0/$ref", + "#/paths/~1wrapped-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/Wrapped/properties/value", + "#/components/schemas/Wrapper/properties/child/0/$ref", + "#/paths/~1wrapped-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/Wrapped/properties/value", - "#/components/schemas/Wrapper/properties/child/0/$ref", - "#/paths/~1wrapped-cycle/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/cycle-detection/output/swap-alternating-cycle-entry.out b/tests/cases/cycle-detection/output/swap-alternating-cycle-entry.out index 118982b..c28d3b2 100644 --- a/tests/cases/cycle-detection/output/swap-alternating-cycle-entry.out +++ b/tests/cases/cycle-detection/output/swap-alternating-cycle-entry.out @@ -14,33 +14,53 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/AltX", - "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/AltX", + "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/AltY", + "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/AltY", - "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/AltY", - "#/components/schemas/AltX/properties/next/$ref", - "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/AltY", + "#/components/schemas/AltX/properties/next/$ref", + "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/AltX", + "#/components/schemas/AltY/properties/next/$ref", + "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/AltX", - "#/components/schemas/AltY/properties/next/$ref", - "#/paths/~1alternating-cycle/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/cycle-detection/output/swap-different-named-cycle.out b/tests/cases/cycle-detection/output/swap-different-named-cycle.out index dd466b2..e6b0321 100644 --- a/tests/cases/cycle-detection/output/swap-different-named-cycle.out +++ b/tests/cases/cycle-detection/output/swap-different-named-cycle.out @@ -23,31 +23,51 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/SelfCycleA", - "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SelfCycleA", + "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/SelfCycleB", + "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/SelfCycleB", - "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/SelfCycleA/properties/value", - "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SelfCycleA/properties/value", + "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/SelfCycleB/properties/value", + "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/SelfCycleB/properties/value", - "#/paths/~1self-cycle/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/add-cookie-parameter.out b/tests/cases/simple/output/add-cookie-parameter.out index 51fbbfa..589dbfd 100644 --- a/tests/cases/simple/output/add-cookie-parameter.out +++ b/tests/cases/simple/output/add-cookie-parameter.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "A new, optional parameter 'tracking' was added", - old_path: [ - "#/paths/~1ping/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1ping/get", + ], + new: [ + "#/paths/~1ping/get/parameters/0", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1ping/get/parameters/0", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "A new, optional parameter 'tracking' was added", + class: ForwardIncompatible, + details: Added, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-default-response.out b/tests/cases/simple/output/add-default-response.out index f363a44..9396245 100644 --- a/tests/cases/simple/output/add-default-response.out +++ b/tests/cases/simple/output/add-default-response.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "operation added a default response", - old_path: [ - "#/paths/~1ping/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1ping/get", + ], + new: [ + "#/paths/~1ping/get", + ], + comparison: Output, + }, ], - new_path: [ - "#/paths/~1ping/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "operation added a default response", + class: Unhandled, + details: Added, + }, ], - comparison: Output, - class: Unhandled, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-header-parameter.out b/tests/cases/simple/output/add-header-parameter.out index 9fea299..4983e6b 100644 --- a/tests/cases/simple/output/add-header-parameter.out +++ b/tests/cases/simple/output/add-header-parameter.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "A new, optional parameter 'X-Trace-Id' was added", - old_path: [ - "#/paths/~1ping/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1ping/get", + ], + new: [ + "#/paths/~1ping/get/parameters/0", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1ping/get/parameters/0", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "A new, optional parameter 'X-Trace-Id' was added", + class: ForwardIncompatible, + details: Added, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-operation-with-id.out b/tests/cases/simple/output/add-operation-with-id.out index 18d243d..16de102 100644 --- a/tests/cases/simple/output/add-operation-with-id.out +++ b/tests/cases/simple/output/add-operation-with-id.out @@ -23,15 +23,25 @@ Result for patch: [ Change { - message: "The operation new_endpoint was added", - old_path: [ - "#/paths", + paths: [ + ChangePath { + old: [ + "#/paths", + ], + new: [ + "#/paths/~1new-endpoint/get", + ], + comparison: Structural, + }, ], - new_path: [ - "#/paths/~1new-endpoint/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The operation new_endpoint was added", + class: ForwardIncompatible, + details: Added, + }, ], - comparison: Structural, - class: ForwardIncompatible, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-operation.out b/tests/cases/simple/output/add-operation.out index c7803ea..23d6f9b 100644 --- a/tests/cases/simple/output/add-operation.out +++ b/tests/cases/simple/output/add-operation.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "The operation was added", - old_path: [ - "#/paths", + paths: [ + ChangePath { + old: [ + "#/paths", + ], + new: [ + "#/paths/~1foo/get", + ], + comparison: Structural, + }, ], - new_path: [ - "#/paths/~1foo/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The operation was added", + class: ForwardIncompatible, + details: Added, + }, ], - comparison: Structural, - class: ForwardIncompatible, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-optional-body.out b/tests/cases/simple/output/add-optional-body.out index aa34604..6d3527d 100644 --- a/tests/cases/simple/output/add-optional-body.out +++ b/tests/cases/simple/output/add-optional-body.out @@ -27,15 +27,25 @@ Result for patch: [ Change { - message: "no body parameter was specified and now one is accepted", - old_path: [ - "#/paths/~1no-body/post", + paths: [ + ChangePath { + old: [ + "#/paths/~1no-body/post", + ], + new: [ + "#/paths/~1no-body/post", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1no-body/post", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "no body parameter was specified and now one is accepted", + class: ForwardIncompatible, + details: Added, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-optional-parameter.out b/tests/cases/simple/output/add-optional-parameter.out index 480f70b..090280d 100644 --- a/tests/cases/simple/output/add-optional-parameter.out +++ b/tests/cases/simple/output/add-optional-parameter.out @@ -21,15 +21,25 @@ Result for patch: [ Change { - message: "A new, optional parameter 'limit' was added", - old_path: [ - "#/paths/~1hello~1{name}/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1hello~1{name}/get", + ], + new: [ + "#/paths/~1hello~1{name}/get/parameters/2", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1hello~1{name}/get/parameters/2", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "A new, optional parameter 'limit' was added", + class: ForwardIncompatible, + details: Added, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-required-body.out b/tests/cases/simple/output/add-required-body.out index 0d43efc..4c76e6c 100644 --- a/tests/cases/simple/output/add-required-body.out +++ b/tests/cases/simple/output/add-required-body.out @@ -27,15 +27,25 @@ Result for patch: [ Change { - message: "no body parameter was specified and now one is required", - old_path: [ - "#/paths/~1no-body/post", + paths: [ + ChangePath { + old: [ + "#/paths/~1no-body/post", + ], + new: [ + "#/paths/~1no-body/post", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1no-body/post", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "no body parameter was specified and now one is required", + class: Incompatible, + details: AddedRequired, + }, ], - comparison: Input, - class: Incompatible, - details: AddedRequired, }, ] diff --git a/tests/cases/simple/output/add-required-parameter.out b/tests/cases/simple/output/add-required-parameter.out index df7a466..ab0ae99 100644 --- a/tests/cases/simple/output/add-required-parameter.out +++ b/tests/cases/simple/output/add-required-parameter.out @@ -21,15 +21,25 @@ Result for patch: [ Change { - message: "A new, required parameter 'format' was added", - old_path: [ - "#/paths/~1hello~1{name}/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1hello~1{name}/get", + ], + new: [ + "#/paths/~1hello~1{name}/get/parameters/2", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1hello~1{name}/get/parameters/2", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "A new, required parameter 'format' was added", + class: BackwardIncompatible, + details: AddedRequired, + }, ], - comparison: Input, - class: BackwardIncompatible, - details: AddedRequired, }, ] diff --git a/tests/cases/simple/output/add-response-code.out b/tests/cases/simple/output/add-response-code.out index 181b8d6..0181b93 100644 --- a/tests/cases/simple/output/add-response-code.out +++ b/tests/cases/simple/output/add-response-code.out @@ -15,15 +15,25 @@ Result for patch: [ Change { - message: "operation added a new response code 500", - old_path: [ - "#/paths/~1ping/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1ping/get", + ], + new: [ + "#/paths/~1ping/get", + ], + comparison: Output, + }, ], - new_path: [ - "#/paths/~1ping/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "operation added a new response code 500", + class: BackwardIncompatible, + details: Added, + }, ], - comparison: Output, - class: BackwardIncompatible, - details: Added, }, ] diff --git a/tests/cases/simple/output/add-type-extension.out b/tests/cases/simple/output/add-type-extension.out index e225bcf..f1ed081 100644 --- a/tests/cases/simple/output/add-type-extension.out +++ b/tests/cases/simple/output/add-type-extension.out @@ -17,17 +17,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/allof-to-anyof.out b/tests/cases/simple/output/allof-to-anyof.out index a1f68b0..b81e3bd 100644 --- a/tests/cases/simple/output/allof-to-anyof.out +++ b/tests/cases/simple/output/allof-to-anyof.out @@ -20,17 +20,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/allof-to-oneof-with-type-change.out b/tests/cases/simple/output/allof-to-oneof-with-type-change.out index 60c4216..ed44066 100644 --- a/tests/cases/simple/output/allof-to-oneof-with-type-change.out +++ b/tests/cases/simple/output/allof-to-oneof-with-type-change.out @@ -30,33 +30,53 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/SubType/properties/value", - "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SubType/properties/value", + "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/SubType/properties/value", + "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/SubType/properties/value", - "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/allof-to-oneof.out b/tests/cases/simple/output/allof-to-oneof.out index c800e11..138bba1 100644 --- a/tests/cases/simple/output/allof-to-oneof.out +++ b/tests/cases/simple/output/allof-to-oneof.out @@ -21,17 +21,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/allof-to-ref-with-type-change.out b/tests/cases/simple/output/allof-to-ref-with-type-change.out index 154d75b..b9e4d5d 100644 --- a/tests/cases/simple/output/allof-to-ref-with-type-change.out +++ b/tests/cases/simple/output/allof-to-ref-with-type-change.out @@ -29,33 +29,53 @@ Result for patch: [ Change { - message: "schema metadata removed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata removed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, Change { - message: "object properties changed", - old_path: [ - "#/components/schemas/SubType", - "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SubType", + "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/SubType", + "#/components/schemas/GreetingResponse/properties/via_allof/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/SubType", - "#/components/schemas/GreetingResponse/properties/via_allof/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/allof-to-ref.out b/tests/cases/simple/output/allof-to-ref.out index cc05304..f678b9f 100644 --- a/tests/cases/simple/output/allof-to-ref.out +++ b/tests/cases/simple/output/allof-to-ref.out @@ -19,17 +19,27 @@ Result for patch: [ Change { - message: "schema metadata removed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_allof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_allof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata removed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/any-schema-change.out b/tests/cases/simple/output/any-schema-change.out index dc506c4..6946867 100644 --- a/tests/cases/simple/output/any-schema-change.out +++ b/tests/cases/simple/output/any-schema-change.out @@ -13,17 +13,27 @@ Result for patch: [ Change { - message: "object properties changed", - old_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/anyof-to-allof.out b/tests/cases/simple/output/anyof-to-allof.out index 54603e5..5c869bc 100644 --- a/tests/cases/simple/output/anyof-to-allof.out +++ b/tests/cases/simple/output/anyof-to-allof.out @@ -20,17 +20,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_anyof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_anyof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_anyof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_anyof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/anyof-to-oneof.out b/tests/cases/simple/output/anyof-to-oneof.out index 7ff5610..0c1e463 100644 --- a/tests/cases/simple/output/anyof-to-oneof.out +++ b/tests/cases/simple/output/anyof-to-oneof.out @@ -21,17 +21,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_anyof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_anyof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_anyof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_anyof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/anyof-to-ref.out b/tests/cases/simple/output/anyof-to-ref.out index d748325..4f3a244 100644 --- a/tests/cases/simple/output/anyof-to-ref.out +++ b/tests/cases/simple/output/anyof-to-ref.out @@ -19,17 +19,27 @@ Result for patch: [ Change { - message: "schema metadata removed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_anyof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_anyof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_anyof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_anyof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata removed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/array-items-add.out b/tests/cases/simple/output/array-items-add.out index 61ccbdb..ff3f591 100644 --- a/tests/cases/simple/output/array-items-add.out +++ b/tests/cases/simple/output/array-items-add.out @@ -15,17 +15,27 @@ Result for patch: [ Change { - message: "array items changed", - old_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "array items changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/array-items-remove.out b/tests/cases/simple/output/array-items-remove.out index f30ddee..0d4f31e 100644 --- a/tests/cases/simple/output/array-items-remove.out +++ b/tests/cases/simple/output/array-items-remove.out @@ -14,18 +14,28 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/Tree", - "#/components/schemas/Tree/properties/children/items/$ref", - "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/Tree", + "#/components/schemas/Tree/properties/children/items/$ref", + "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/Tree/properties/children/items", + "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/Tree/properties/children/items", - "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/array-max-items-change.out b/tests/cases/simple/output/array-max-items-change.out index ca1389e..1057ee5 100644 --- a/tests/cases/simple/output/array-max-items-change.out +++ b/tests/cases/simple/output/array-max-items-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "array maxItems changed", - old_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "array maxItems changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/array-min-items-change.out b/tests/cases/simple/output/array-min-items-change.out index 44b8d48..d2e39df 100644 --- a/tests/cases/simple/output/array-min-items-change.out +++ b/tests/cases/simple/output/array-min-items-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "array minItems changed", - old_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "array minItems changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/array-unique-items-change.out b/tests/cases/simple/output/array-unique-items-change.out index b45d105..3561ec6 100644 --- a/tests/cases/simple/output/array-unique-items-change.out +++ b/tests/cases/simple/output/array-unique-items-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "array uniqueItems changed", - old_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ArrayWithConstraints", + "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ArrayWithConstraints", - "#/paths/~1arrays/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "array uniqueItems changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/body-description-change.out b/tests/cases/simple/output/body-description-change.out index 80af1ac..70d0cf7 100644 --- a/tests/cases/simple/output/body-description-change.out +++ b/tests/cases/simple/output/body-description-change.out @@ -13,15 +13,25 @@ Result for patch: [ Change { - message: "the body metadata (description or extensions) changed", - old_path: [ - "#/paths/~1items/post", + paths: [ + ChangePath { + old: [ + "#/paths/~1items/post", + ], + new: [ + "#/paths/~1items/post", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1items/post", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "the body metadata (description or extensions) changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Input, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/body-extension-change.out b/tests/cases/simple/output/body-extension-change.out index 927d8d6..412535e 100644 --- a/tests/cases/simple/output/body-extension-change.out +++ b/tests/cases/simple/output/body-extension-change.out @@ -15,15 +15,25 @@ Result for patch: [ Change { - message: "the body metadata (description or extensions) changed", - old_path: [ - "#/paths/~1items/post", + paths: [ + ChangePath { + old: [ + "#/paths/~1items/post", + ], + new: [ + "#/paths/~1items/post", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1items/post", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "the body metadata (description or extensions) changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Input, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/body-optional-to-required.out b/tests/cases/simple/output/body-optional-to-required.out index 841a6e9..1140bc4 100644 --- a/tests/cases/simple/output/body-optional-to-required.out +++ b/tests/cases/simple/output/body-optional-to-required.out @@ -14,15 +14,25 @@ Result for patch: [ Change { - message: "the body parameter was optional and is now required", - old_path: [ - "#/paths/~1items/put", + paths: [ + ChangePath { + old: [ + "#/paths/~1items/put", + ], + new: [ + "#/paths/~1items/put", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1items/put", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "the body parameter was optional and is now required", + class: BackwardIncompatible, + details: MoreStrict, + }, ], - comparison: Input, - class: BackwardIncompatible, - details: MoreStrict, }, ] diff --git a/tests/cases/simple/output/body-required-to-optional.out b/tests/cases/simple/output/body-required-to-optional.out index 9784dc9..1216579 100644 --- a/tests/cases/simple/output/body-required-to-optional.out +++ b/tests/cases/simple/output/body-required-to-optional.out @@ -14,15 +14,25 @@ Result for patch: [ Change { - message: "the body parameter was required and is now optional", - old_path: [ - "#/paths/~1items/post", + paths: [ + ChangePath { + old: [ + "#/paths/~1items/post", + ], + new: [ + "#/paths/~1items/post", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1items/post", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "the body parameter was required and is now optional", + class: ForwardIncompatible, + details: LessStrict, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: LessStrict, }, ] diff --git a/tests/cases/simple/output/boolean-change.out b/tests/cases/simple/output/boolean-change.out index 246caec..9d002e0 100644 --- a/tests/cases/simple/output/boolean-change.out +++ b/tests/cases/simple/output/boolean-change.out @@ -13,17 +13,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/TypedProperties/properties/enabled", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/TypedProperties/properties/enabled", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/TypedProperties/properties/enabled", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/TypedProperties/properties/enabled", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/boolean-enum-change.out b/tests/cases/simple/output/boolean-enum-change.out index ee70159..37bf0eb 100644 --- a/tests/cases/simple/output/boolean-enum-change.out +++ b/tests/cases/simple/output/boolean-enum-change.out @@ -15,17 +15,27 @@ Result for patch: [ Change { - message: "boolean schema changed", - old_path: [ - "#/components/schemas/TypedProperties/properties/enabled", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/TypedProperties/properties/enabled", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/TypedProperties/properties/enabled", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/TypedProperties/properties/enabled", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "boolean schema changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/change-header-parameter.out b/tests/cases/simple/output/change-header-parameter.out index 90e9fd9..b506dce 100644 --- a/tests/cases/simple/output/change-header-parameter.out +++ b/tests/cases/simple/output/change-header-parameter.out @@ -14,15 +14,25 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/paths/~1with-header/get/parameters/0/schema", + paths: [ + ChangePath { + old: [ + "#/paths/~1with-header/get/parameters/0/schema", + ], + new: [ + "#/paths/~1with-header/get/parameters/0/schema", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1with-header/get/parameters/0/schema", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Input, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/change-operation-parameter-requirement.out b/tests/cases/simple/output/change-operation-parameter-requirement.out index e4d4853..974f59a 100644 --- a/tests/cases/simple/output/change-operation-parameter-requirement.out +++ b/tests/cases/simple/output/change-operation-parameter-requirement.out @@ -14,15 +14,25 @@ Result for patch: [ Change { - message: "The parameter 'language' was optional and is now required", - old_path: [ - "#/paths/~1hello~1{name}/get/parameters/1", + paths: [ + ChangePath { + old: [ + "#/paths/~1hello~1{name}/get/parameters/1", + ], + new: [ + "#/paths/~1hello~1{name}/get/parameters/1", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1hello~1{name}/get/parameters/1", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The parameter 'language' was optional and is now required", + class: BackwardIncompatible, + details: MoreStrict, + }, ], - comparison: Input, - class: BackwardIncompatible, - details: MoreStrict, }, ] diff --git a/tests/cases/simple/output/change-operation-parameter-type.out b/tests/cases/simple/output/change-operation-parameter-type.out index 53863f9..9252a75 100644 --- a/tests/cases/simple/output/change-operation-parameter-type.out +++ b/tests/cases/simple/output/change-operation-parameter-type.out @@ -14,15 +14,25 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/paths/~1hello~1{name}/get/parameters/1/schema", + paths: [ + ChangePath { + old: [ + "#/paths/~1hello~1{name}/get/parameters/1/schema", + ], + new: [ + "#/paths/~1hello~1{name}/get/parameters/1/schema", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1hello~1{name}/get/parameters/1/schema", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Input, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/change-property-type.out b/tests/cases/simple/output/change-property-type.out index 57f6eee..0084054 100644 --- a/tests/cases/simple/output/change-property-type.out +++ b/tests/cases/simple/output/change-property-type.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/message", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/message", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/message", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/message", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/enum-to-oneof.out b/tests/cases/simple/output/enum-to-oneof.out index 402250f..eb074c0 100644 --- a/tests/cases/simple/output/enum-to-oneof.out +++ b/tests/cases/simple/output/enum-to-oneof.out @@ -42,19 +42,29 @@ Result for patch: [ Change { - message: "schema kind changed from any to oneOf with equivalent enum values", - old_path: [ - "#/components/schemas/ItemKind", - "#/components/schemas/CreateItem/properties/kind/$ref", - "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ItemKind", + "#/components/schemas/CreateItem/properties/kind/$ref", + "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ItemKind", + "#/components/schemas/CreateItem/properties/kind/$ref", + "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + ], + comparison: Input, + }, ], - new_path: [ - "#/components/schemas/ItemKind", - "#/components/schemas/CreateItem/properties/kind/$ref", - "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema kind changed from any to oneOf with equivalent enum values", + class: Trivial, + details: Metadata, + }, ], - comparison: Input, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/inline-to-allof.out b/tests/cases/simple/output/inline-to-allof.out index 8c43487..954ca32 100644 --- a/tests/cases/simple/output/inline-to-allof.out +++ b/tests/cases/simple/output/inline-to-allof.out @@ -19,15 +19,25 @@ Result for patch: [ Change { - message: "schema metadata added", - old_path: [ - "#/paths/~1hello~1{name}/get/parameters/0/schema", + paths: [ + ChangePath { + old: [ + "#/paths/~1hello~1{name}/get/parameters/0/schema", + ], + new: [ + "#/paths/~1hello~1{name}/get/parameters/0/schema", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1hello~1{name}/get/parameters/0/schema", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata added", + class: Trivial, + details: Metadata, + }, ], - comparison: Input, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/integer-format-change.out b/tests/cases/simple/output/integer-format-change.out index 621e470..14535bd 100644 --- a/tests/cases/simple/output/integer-format-change.out +++ b/tests/cases/simple/output/integer-format-change.out @@ -13,17 +13,27 @@ Result for patch: [ Change { - message: "integer schema changed", - old_path: [ - "#/components/schemas/TypedProperties/properties/count", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/TypedProperties/properties/count", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/TypedProperties/properties/count", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/TypedProperties/properties/count", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "integer schema changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/modify-cycle-type.out b/tests/cases/simple/output/modify-cycle-type.out index 19df865..6fb2fa4 100644 --- a/tests/cases/simple/output/modify-cycle-type.out +++ b/tests/cases/simple/output/modify-cycle-type.out @@ -17,18 +17,28 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/Tree/properties/children", - "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/Tree/properties/children", + "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/Tree", + "#/components/schemas/Tree/properties/children/$ref", + "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/Tree", - "#/components/schemas/Tree/properties/children/$ref", - "#/paths/~1tree/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/multi-allof-variant-change.out b/tests/cases/simple/output/multi-allof-variant-change.out index 9cf3348..b6b73fc 100644 --- a/tests/cases/simple/output/multi-allof-variant-change.out +++ b/tests/cases/simple/output/multi-allof-variant-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "allOf with multiple schemas is unhandled", - old_path: [ - "#/components/schemas/MultiAllOf/allOf", - "#/paths/~1allof/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/MultiAllOf/allOf", + "#/paths/~1allof/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/MultiAllOf/allOf", + "#/paths/~1allof/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/MultiAllOf/allOf", - "#/paths/~1allof/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "allOf with multiple schemas is unhandled", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/multi-anyof-variant-change.out b/tests/cases/simple/output/multi-anyof-variant-change.out index 1ead364..f82c97e 100644 --- a/tests/cases/simple/output/multi-anyof-variant-change.out +++ b/tests/cases/simple/output/multi-anyof-variant-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "unhandled, 'anyOf' schema", - old_path: [ - "#/components/schemas/AnyOfExample", - "#/paths/~1anyof/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/AnyOfExample", + "#/paths/~1anyof/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/AnyOfExample", + "#/paths/~1anyof/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/AnyOfExample", - "#/paths/~1anyof/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "unhandled, 'anyOf' schema", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/multi-oneof-count-change.out b/tests/cases/simple/output/multi-oneof-count-change.out index 2e4ab21..94ebd88 100644 --- a/tests/cases/simple/output/multi-oneof-count-change.out +++ b/tests/cases/simple/output/multi-oneof-count-change.out @@ -15,17 +15,27 @@ Result for patch: [ Change { - message: "oneOf schema count changed", - old_path: [ - "#/components/schemas/MultiOneOf/oneOf", - "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/MultiOneOf/oneOf", + "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/MultiOneOf/oneOf", + "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/MultiOneOf/oneOf", - "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "oneOf schema count changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/multi-oneof-variant-change.out b/tests/cases/simple/output/multi-oneof-variant-change.out index ca20ee2..95ffac8 100644 --- a/tests/cases/simple/output/multi-oneof-variant-change.out +++ b/tests/cases/simple/output/multi-oneof-variant-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/MultiOneOf/oneOf/0", - "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/MultiOneOf/oneOf/0", + "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/MultiOneOf/oneOf/0", + "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/MultiOneOf/oneOf/0", - "#/paths/~1oneof/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/not-inner-to-allof.out b/tests/cases/simple/output/not-inner-to-allof.out index c5e70e0..47df17f 100644 --- a/tests/cases/simple/output/not-inner-to-allof.out +++ b/tests/cases/simple/output/not-inner-to-allof.out @@ -19,17 +19,27 @@ Result for patch: [ Change { - message: "schema metadata added", - old_path: [ - "#/components/schemas/GreetingResponse/properties/not_a_number/not", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/not_a_number/not", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/not_a_number/not", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/not_a_number/not", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata added", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/not-to-allof.out b/tests/cases/simple/output/not-to-allof.out index a31c5f5..4af3db6 100644 --- a/tests/cases/simple/output/not-to-allof.out +++ b/tests/cases/simple/output/not-to-allof.out @@ -23,17 +23,27 @@ Result for patch: [ Change { - message: "schema metadata added", - old_path: [ - "#/components/schemas/GreetingResponse/properties/not_a_number", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/not_a_number", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/not_a_number", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/not_a_number", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata added", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/number-constraints-change.out b/tests/cases/simple/output/number-constraints-change.out index a7088cc..5754482 100644 --- a/tests/cases/simple/output/number-constraints-change.out +++ b/tests/cases/simple/output/number-constraints-change.out @@ -13,17 +13,27 @@ Result for patch: [ Change { - message: "number schema changed", - old_path: [ - "#/components/schemas/TypedProperties/properties/ratio", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/TypedProperties/properties/ratio", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/TypedProperties/properties/ratio", + "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/TypedProperties/properties/ratio", - "#/paths/~1typed/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "number schema changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/object-additional-props-false.out b/tests/cases/simple/output/object-additional-props-false.out index 2fda705..5535517 100644 --- a/tests/cases/simple/output/object-additional-props-false.out +++ b/tests/cases/simple/output/object-additional-props-false.out @@ -16,17 +16,27 @@ Result for patch: [ Change { - message: "object additionalProperties changed", - old_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object additionalProperties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/object-additional-props-schema-change.out b/tests/cases/simple/output/object-additional-props-schema-change.out index b2218fb..3248286 100644 --- a/tests/cases/simple/output/object-additional-props-schema-change.out +++ b/tests/cases/simple/output/object-additional-props-schema-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/ObjectWithConstraints/additionalProperties", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ObjectWithConstraints/additionalProperties", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ObjectWithConstraints/additionalProperties", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ObjectWithConstraints/additionalProperties", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/object-additional-props-type-change.out b/tests/cases/simple/output/object-additional-props-type-change.out index d90217c..1bbc3f2 100644 --- a/tests/cases/simple/output/object-additional-props-type-change.out +++ b/tests/cases/simple/output/object-additional-props-type-change.out @@ -16,17 +16,27 @@ Result for patch: [ Change { - message: "object additionalProperties changed", - old_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object additionalProperties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/object-max-properties-change.out b/tests/cases/simple/output/object-max-properties-change.out index a7bf74c..53110fc 100644 --- a/tests/cases/simple/output/object-max-properties-change.out +++ b/tests/cases/simple/output/object-max-properties-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "object maxProperties changed", - old_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object maxProperties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/object-min-properties-change.out b/tests/cases/simple/output/object-min-properties-change.out index 0d8fdea..067d2c9 100644 --- a/tests/cases/simple/output/object-min-properties-change.out +++ b/tests/cases/simple/output/object-min-properties-change.out @@ -14,17 +14,27 @@ Result for patch: [ Change { - message: "object minProperties changed", - old_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ObjectWithConstraints", + "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ObjectWithConstraints", - "#/paths/~1objects/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object minProperties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/oneof-to-allof.out b/tests/cases/simple/output/oneof-to-allof.out index 7f44ff1..c87dc7a 100644 --- a/tests/cases/simple/output/oneof-to-allof.out +++ b/tests/cases/simple/output/oneof-to-allof.out @@ -21,17 +21,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_oneof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_oneof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_oneof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_oneof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/oneof-to-anyof.out b/tests/cases/simple/output/oneof-to-anyof.out index 627d55f..9351060 100644 --- a/tests/cases/simple/output/oneof-to-anyof.out +++ b/tests/cases/simple/output/oneof-to-anyof.out @@ -21,17 +21,27 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_oneof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_oneof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_oneof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_oneof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/oneof-to-enum.out b/tests/cases/simple/output/oneof-to-enum.out index 1baa069..2b26336 100644 --- a/tests/cases/simple/output/oneof-to-enum.out +++ b/tests/cases/simple/output/oneof-to-enum.out @@ -38,19 +38,29 @@ Result for patch: [ Change { - message: "schema kind changed from oneOf to any with equivalent enum values", - old_path: [ - "#/components/schemas/ItemType", - "#/components/schemas/CreateItem/properties/type/$ref", - "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ItemType", + "#/components/schemas/CreateItem/properties/type/$ref", + "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ItemType", + "#/components/schemas/CreateItem/properties/type/$ref", + "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + ], + comparison: Input, + }, ], - new_path: [ - "#/components/schemas/ItemType", - "#/components/schemas/CreateItem/properties/type/$ref", - "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema kind changed from oneOf to any with equivalent enum values", + class: Trivial, + details: Metadata, + }, ], - comparison: Input, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/oneof-to-ref.out b/tests/cases/simple/output/oneof-to-ref.out index 22ef9d6..448379e 100644 --- a/tests/cases/simple/output/oneof-to-ref.out +++ b/tests/cases/simple/output/oneof-to-ref.out @@ -19,17 +19,27 @@ Result for patch: [ Change { - message: "schema metadata removed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_oneof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_oneof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_oneof", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_oneof", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata removed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/param-required-to-optional.out b/tests/cases/simple/output/param-required-to-optional.out index 1614909..1419a39 100644 --- a/tests/cases/simple/output/param-required-to-optional.out +++ b/tests/cases/simple/output/param-required-to-optional.out @@ -14,15 +14,25 @@ Result for patch: [ Change { - message: "The parameter 'X-Request-Id' was required and is now optional", - old_path: [ - "#/paths/~1with-header/get/parameters/0", + paths: [ + ChangePath { + old: [ + "#/paths/~1with-header/get/parameters/0", + ], + new: [ + "#/paths/~1with-header/get/parameters/0", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1with-header/get/parameters/0", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The parameter 'X-Request-Id' was required and is now optional", + class: ForwardIncompatible, + details: LessStrict, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: LessStrict, }, ] diff --git a/tests/cases/simple/output/param-schema-to-content.out b/tests/cases/simple/output/param-schema-to-content.out index afa9481..2ff8551 100644 --- a/tests/cases/simple/output/param-schema-to-content.out +++ b/tests/cases/simple/output/param-schema-to-content.out @@ -27,15 +27,25 @@ Result for patch: [ Change { - message: "Unhandled change to parameter schema or content", - old_path: [ - "#/paths/~1hello~1{name}/get/parameters/1", + paths: [ + ChangePath { + old: [ + "#/paths/~1hello~1{name}/get/parameters/1", + ], + new: [ + "#/paths/~1hello~1{name}/get/parameters/1", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1hello~1{name}/get/parameters/1", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "Unhandled change to parameter schema or content", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Input, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/ref-chain-change.out b/tests/cases/simple/output/ref-chain-change.out index e0a3a54..939c83e 100644 --- a/tests/cases/simple/output/ref-chain-change.out +++ b/tests/cases/simple/output/ref-chain-change.out @@ -14,39 +14,59 @@ Result for patch: [ Change { - message: "object required properties changed", - old_path: [ - "#/components/schemas/SubType", - "#/components/schemas/RefChainB/$ref", - "#/components/schemas/RefChainA/$ref", - "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SubType", + "#/components/schemas/RefChainB/$ref", + "#/components/schemas/RefChainA/$ref", + "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ErrorResponse", + "#/components/schemas/RefChainB/$ref", + "#/components/schemas/RefChainA/$ref", + "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ErrorResponse", - "#/components/schemas/RefChainB/$ref", - "#/components/schemas/RefChainA/$ref", - "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object required properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, Change { - message: "object properties changed", - old_path: [ - "#/components/schemas/SubType", - "#/components/schemas/RefChainB/$ref", - "#/components/schemas/RefChainA/$ref", - "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SubType", + "#/components/schemas/RefChainB/$ref", + "#/components/schemas/RefChainA/$ref", + "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ErrorResponse", + "#/components/schemas/RefChainB/$ref", + "#/components/schemas/RefChainA/$ref", + "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/ErrorResponse", - "#/components/schemas/RefChainB/$ref", - "#/components/schemas/RefChainA/$ref", - "#/paths/~1refs/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/ref-to-allof.out b/tests/cases/simple/output/ref-to-allof.out index 381c173..3316bd2 100644 --- a/tests/cases/simple/output/ref-to-allof.out +++ b/tests/cases/simple/output/ref-to-allof.out @@ -19,17 +19,27 @@ Result for patch: [ Change { - message: "schema metadata added", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata added", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/ref-to-anyof.out b/tests/cases/simple/output/ref-to-anyof.out index ac48522..3349ae3 100644 --- a/tests/cases/simple/output/ref-to-anyof.out +++ b/tests/cases/simple/output/ref-to-anyof.out @@ -19,17 +19,27 @@ Result for patch: [ Change { - message: "schema metadata added", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata added", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/ref-to-inline-allof.out b/tests/cases/simple/output/ref-to-inline-allof.out index 107fd1f..311ff4e 100644 --- a/tests/cases/simple/output/ref-to-inline-allof.out +++ b/tests/cases/simple/output/ref-to-inline-allof.out @@ -25,32 +25,52 @@ Result for patch: [ Change { - message: "schema metadata added", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata added", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/SubType", - "#/components/schemas/GreetingResponse/properties/via_ref/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SubType", + "#/components/schemas/GreetingResponse/properties/via_ref/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_ref/0", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref/0", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/ref-to-oneof.out b/tests/cases/simple/output/ref-to-oneof.out index cccb7a3..7224c41 100644 --- a/tests/cases/simple/output/ref-to-oneof.out +++ b/tests/cases/simple/output/ref-to-oneof.out @@ -19,17 +19,27 @@ Result for patch: [ Change { - message: "schema metadata added", - old_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/via_ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/via_ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata added", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/remove-default-response.out b/tests/cases/simple/output/remove-default-response.out index c714100..98047b6 100644 --- a/tests/cases/simple/output/remove-default-response.out +++ b/tests/cases/simple/output/remove-default-response.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "operation removed a default response", - old_path: [ - "#/paths/~1with-default/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1with-default/get", + ], + new: [ + "#/paths/~1with-default/get", + ], + comparison: Output, + }, ], - new_path: [ - "#/paths/~1with-default/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "operation removed a default response", + class: Unhandled, + details: Removed, + }, ], - comparison: Output, - class: Unhandled, - details: Removed, }, ] diff --git a/tests/cases/simple/output/remove-header-parameter.out b/tests/cases/simple/output/remove-header-parameter.out index 8cc1104..ce18379 100644 --- a/tests/cases/simple/output/remove-header-parameter.out +++ b/tests/cases/simple/output/remove-header-parameter.out @@ -20,15 +20,25 @@ Result for patch: [ Change { - message: "The parameter 'X-Request-Id' was removed", - old_path: [ - "#/paths/~1with-header/get/parameters/0", + paths: [ + ChangePath { + old: [ + "#/paths/~1with-header/get/parameters/0", + ], + new: [ + "#/paths/~1with-header/get", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1with-header/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The parameter 'X-Request-Id' was removed", + class: BackwardIncompatible, + details: Removed, + }, ], - comparison: Input, - class: BackwardIncompatible, - details: Removed, }, ] diff --git a/tests/cases/simple/output/remove-operation-parameter.out b/tests/cases/simple/output/remove-operation-parameter.out index 1076bfe..b539ab5 100644 --- a/tests/cases/simple/output/remove-operation-parameter.out +++ b/tests/cases/simple/output/remove-operation-parameter.out @@ -21,15 +21,25 @@ Result for patch: [ Change { - message: "The parameter 'language' was removed", - old_path: [ - "#/paths/~1hello~1{name}/get/parameters/1", + paths: [ + ChangePath { + old: [ + "#/paths/~1hello~1{name}/get/parameters/1", + ], + new: [ + "#/paths/~1hello~1{name}/get", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1hello~1{name}/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The parameter 'language' was removed", + class: BackwardIncompatible, + details: Removed, + }, ], - comparison: Input, - class: BackwardIncompatible, - details: Removed, }, ] diff --git a/tests/cases/simple/output/remove-operation.out b/tests/cases/simple/output/remove-operation.out index 59c4268..e2cf632 100644 --- a/tests/cases/simple/output/remove-operation.out +++ b/tests/cases/simple/output/remove-operation.out @@ -25,15 +25,25 @@ Result for patch: [ Change { - message: "The operation ping was removed", - old_path: [ - "#/paths/~1ping/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1ping/get", + ], + new: [ + "#/paths", + ], + comparison: Structural, + }, ], - new_path: [ - "#/paths", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The operation ping was removed", + class: BackwardIncompatible, + details: Removed, + }, ], - comparison: Structural, - class: BackwardIncompatible, - details: Removed, }, ] diff --git a/tests/cases/simple/output/remove-optional-body.out b/tests/cases/simple/output/remove-optional-body.out index 02239b2..4f88a2a 100644 --- a/tests/cases/simple/output/remove-optional-body.out +++ b/tests/cases/simple/output/remove-optional-body.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "an optional body parameter was removed", - old_path: [ - "#/paths/~1items/put", + paths: [ + ChangePath { + old: [ + "#/paths/~1items/put", + ], + new: [ + "#/paths/~1items/put", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1items/put", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "an optional body parameter was removed", + class: ForwardIncompatible, + details: Removed, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: Removed, }, ] diff --git a/tests/cases/simple/output/remove-required-body.out b/tests/cases/simple/output/remove-required-body.out index ff420d0..e7919bb 100644 --- a/tests/cases/simple/output/remove-required-body.out +++ b/tests/cases/simple/output/remove-required-body.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "a required body parameter was removed", - old_path: [ - "#/paths/~1items/post", + paths: [ + ChangePath { + old: [ + "#/paths/~1items/post", + ], + new: [ + "#/paths/~1items/post", + ], + comparison: Input, + }, ], - new_path: [ - "#/paths/~1items/post", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "a required body parameter was removed", + class: ForwardIncompatible, + details: Removed, + }, ], - comparison: Input, - class: ForwardIncompatible, - details: Removed, }, ] diff --git a/tests/cases/simple/output/remove-response-code.out b/tests/cases/simple/output/remove-response-code.out index fad59bf..ea17cf9 100644 --- a/tests/cases/simple/output/remove-response-code.out +++ b/tests/cases/simple/output/remove-response-code.out @@ -15,15 +15,25 @@ Result for patch: [ Change { - message: "operation no longer responds with status 200", - old_path: [ - "#/paths/~1with-default/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1with-default/get", + ], + new: [ + "#/paths/~1with-default/get", + ], + comparison: Output, + }, ], - new_path: [ - "#/paths/~1with-default/get", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "operation no longer responds with status 200", + class: ForwardIncompatible, + details: Removed, + }, ], - comparison: Output, - class: ForwardIncompatible, - details: Removed, }, ] diff --git a/tests/cases/simple/output/remove-unnamed-operation.out b/tests/cases/simple/output/remove-unnamed-operation.out index b246f75..61326da 100644 --- a/tests/cases/simple/output/remove-unnamed-operation.out +++ b/tests/cases/simple/output/remove-unnamed-operation.out @@ -22,15 +22,25 @@ Result for patch: [ Change { - message: "The operation was removed", - old_path: [ - "#/paths/~1unnamed/get", + paths: [ + ChangePath { + old: [ + "#/paths/~1unnamed/get", + ], + new: [ + "#/paths", + ], + comparison: Structural, + }, ], - new_path: [ - "#/paths", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "The operation was removed", + class: BackwardIncompatible, + details: Removed, + }, ], - comparison: Structural, - class: BackwardIncompatible, - details: Removed, }, ] diff --git a/tests/cases/simple/output/schema-kind-type-to-oneof.out b/tests/cases/simple/output/schema-kind-type-to-oneof.out index 6c05f23..c9753c3 100644 --- a/tests/cases/simple/output/schema-kind-type-to-oneof.out +++ b/tests/cases/simple/output/schema-kind-type-to-oneof.out @@ -24,19 +24,29 @@ Result for patch: [ Change { - message: "schema kind changed from regular type to oneOf", - old_path: [ - "#/components/schemas/SubType", - "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SubType", + "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/SubType", + "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/SubType", - "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema kind changed from regular type to oneOf", + class: Incompatible, + details: Datatype, + }, ], - comparison: Output, - class: Incompatible, - details: Datatype, }, ] diff --git a/tests/cases/simple/output/string-format-change.out b/tests/cases/simple/output/string-format-change.out index 1ece512..ed74d51 100644 --- a/tests/cases/simple/output/string-format-change.out +++ b/tests/cases/simple/output/string-format-change.out @@ -13,17 +13,27 @@ Result for patch: [ Change { - message: "string schema changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/message", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/message", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse/properties/message", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse/properties/message", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "string schema changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/type-indirection.out b/tests/cases/simple/output/type-indirection.out index 0aed074..b751f44 100644 --- a/tests/cases/simple/output/type-indirection.out +++ b/tests/cases/simple/output/type-indirection.out @@ -29,18 +29,28 @@ Result for patch: [ Change { - message: "schema metadata changed", - old_path: [ - "#/components/schemas/GreetingResponse/properties/message", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse/properties/message", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponseMessage", + "#/components/schemas/GreetingResponse/properties/message/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponseMessage", - "#/components/schemas/GreetingResponse/properties/message/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema metadata changed", + class: Trivial, + details: Metadata, + }, ], - comparison: Output, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/unhandled-add-prop.out b/tests/cases/simple/output/unhandled-add-prop.out index 0525b81..c45ca6f 100644 --- a/tests/cases/simple/output/unhandled-add-prop.out +++ b/tests/cases/simple/output/unhandled-add-prop.out @@ -26,31 +26,51 @@ Result for patch: [ Change { - message: "object required properties changed", - old_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object required properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, Change { - message: "object properties changed", - old_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/GreetingResponse", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/GreetingResponse", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "object properties changed", + class: Unhandled, + details: UnknownDifference, + }, ], - comparison: Output, - class: Unhandled, - details: UnknownDifference, }, ] diff --git a/tests/cases/simple/output/untyped-to-typed-enum.out b/tests/cases/simple/output/untyped-to-typed-enum.out index 48a734f..0b62fc6 100644 --- a/tests/cases/simple/output/untyped-to-typed-enum.out +++ b/tests/cases/simple/output/untyped-to-typed-enum.out @@ -15,19 +15,29 @@ Result for patch: [ Change { - message: "schema kind changed from any to regular type with equivalent enum values", - old_path: [ - "#/components/schemas/ItemKind", - "#/components/schemas/CreateItem/properties/kind/$ref", - "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/ItemKind", + "#/components/schemas/CreateItem/properties/kind/$ref", + "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/ItemKind", + "#/components/schemas/CreateItem/properties/kind/$ref", + "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + ], + comparison: Input, + }, ], - new_path: [ - "#/components/schemas/ItemKind", - "#/components/schemas/CreateItem/properties/kind/$ref", - "#/paths/~1items/post/request_body/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema kind changed from any to regular type with equivalent enum values", + class: Trivial, + details: Metadata, + }, ], - comparison: Input, - class: Trivial, - details: Metadata, }, ] diff --git a/tests/cases/simple/output/wrapper-unchanged-with-type-change.out b/tests/cases/simple/output/wrapper-unchanged-with-type-change.out index 18e3fe6..908f776 100644 --- a/tests/cases/simple/output/wrapper-unchanged-with-type-change.out +++ b/tests/cases/simple/output/wrapper-unchanged-with-type-change.out @@ -14,19 +14,29 @@ Result for patch: [ Change { - message: "schema types changed", - old_path: [ - "#/components/schemas/SubType/properties/value", - "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + paths: [ + ChangePath { + old: [ + "#/components/schemas/SubType/properties/value", + "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + new: [ + "#/components/schemas/SubType/properties/value", + "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", + "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + ], + comparison: Output, + }, ], - new_path: [ - "#/components/schemas/SubType/properties/value", - "#/components/schemas/GreetingResponse/properties/via_allof/0/$ref", - "#/paths/~1hello~1{name}/get/responses/200/content/application~1json/schema/$ref", + changes: [ + ChangeInfo { + old_subpath: "", + new_subpath: "", + message: "schema types changed", + class: Incompatible, + details: UnknownDifference, + }, ], - comparison: Output, - class: Incompatible, - details: UnknownDifference, }, ]