git.iko.soy/typeable/compaREST
on master help sign in
Add special reporting for when type-restricting clauses have been added (#96)

* Add special reporting for when type-restricting clauses have been added * Add a note for if issues arise due to a property going from "additionalProperties" to "properties" * Changed some wording. Instead of referencing properties by name, errors are now embedded in the behaviour. * Changed wording of TypesRestricted Co-authored-by: iko <ilyakooo0@gmail.com>

commit53ba00e5b6c244a83197f32e19475fa0accf5dc4 authormniip <mniip@users.noreply.github.com> dateThu 1 Jul 2021, 17:53 (5 years ago) parent62a321a
12 files changed+515−50
src/OpenAPI/Checker/Subtree.hs+10−1 src/OpenAPI/Checker/Validate/Schema.hs+66−24 test/golden/common/property-removed-additional/report.md+19−5 test/golden/common/property-removed-additional/trace-tree.yaml+10−2 test/golden/common/property-removed/report.md+8−8 test/golden/common/property-removed/trace-tree.yaml+8−4 test/golden/common/property-required/report.md+4−4 test/golden/common/property-required/trace-tree.yaml+4−2 test/golden/common/type-changing/a.yaml+113 test/golden/common/type-changing/b.yaml+108 test/golden/common/type-changing/report.md+105 test/golden/common/type-changing/trace-tree.yaml+60
src/OpenAPI/Checker/Subtree.hs+10−1
@@ -27,6 +27,7 @@ module OpenAPI.Checker.Subtree
2727 , invertIssueOrientationP
2828 , embedFormula
2929 , anyOfAt
30+ , clarifyIssue
3031 , structuralIssue
3132
3233 -- * Structural helpers
@@ -316,7 +317,15 @@ anyOfAt
316317 -> CompatFormula' q AnIssue r a
317318anyOfAt _ _ [x] = x
318319anyOfAt xs issue fs =
319− Compose $ (`eitherOf` AnItem xs (anIssue issue)) <$> sequenceA (getCompose <$> fs)
320+ Compose $ (`eitherOf` AnItem xs (anIssue issue)) <$> traverse getCompose fs
321+
322+-- | If the given formula contains any issues, add another issue on top. Otherwise succeed.
323+clarifyIssue
324+ :: AnItem q AnIssue r
325+ -> CompatFormula' q AnIssue r a
326+ -> CompatFormula' q AnIssue r a
327+clarifyIssue item f =
328+ Compose ((`eitherOf` item) <$> pure <$> getCompose f) *> f
320329
321330fixpointKnot
322331 :: MonadState (MemoState VarRef) m
src/OpenAPI/Checker/Validate/Schema.hs+66−24
@@ -843,10 +843,18 @@ checkFormulas env beh (ProdCons (fp, ep) (fc, ec)) =
843843 -- (⋃_i ⋂_j A[i,j]) ⊂ ∅ = /\_i (⋂_j A[i,j]) ⊂ ∅
844844 -- where we again delegate (⋂_j A[j]) ⊂ ∅ to a heuristic, though here the
845845 -- shortcut of \/_j A[j] ⊂ ∅ hardly helps.
846+ let typesRestricted = not (anyBottomTypes fp) && anyBottomTypes fc
847+ -- Specifically handle the case when a schema's type has been
848+ -- restricted from "all" to specific types: if all types were allowed
849+ -- in the producer and not all types are allowed in the consumer, it's
850+ -- usually easier to say what's left than what's removed
851+ when typesRestricted $ issueAt beh $ TypesRestricted $ nonBottomTypes fc
846852 forType_ $ \tyName ty -> do
847853 let beh' = beh >>> step (OfType tyName)
848854 case (ty fp, ty fc) of
849− (DNF pss, BottomFormula) -> F.for_ pss $ \(Conjunct ps) -> checkContradiction beh' ps
855+ (DNF pss, BottomFormula) -> unless typesRestricted $ do
856+ -- don't repeat the TypesRestricted issue
857+ F.for_ pss $ \(Conjunct ps) -> checkContradiction beh' ps
850858 (DNF pss, SingleConjunct cs) -> F.for_ pss $ \(Conjunct ps) -> do
851859 F.for_ cs $ checkImplication env beh' ps -- avoid disjunction if there's only one conjunct
852860 (TopFormula, DNF css) ->
@@ -859,7 +867,15 @@ checkFormulas env beh (ProdCons (fp, ep) (fc, ec)) =
859867 beh'
860868 (issueFromConjunct ps)
861869 [F.for_ cs $ checkImplication env beh' ps | Conjunct cs <- S.toList css]
870+ pure ()
862871 where
872+ anyBottomTypes f = getAny $
873+ foldType $ \_ ty -> case ty f of
874+ BottomFormula -> Any True
875+ _ -> mempty
876+ nonBottomTypes f = foldType $ \tyName ty -> case ty f of
877+ BottomFormula -> mempty
878+ _ -> [tyName]
863879 issueFromConjunct :: Typeable t => [Condition t] -> Issue 'TypedSchemaLevel
864880 issueFromConjunct ps
865881 | Just e <- findExactly ps
@@ -959,20 +975,26 @@ checkImplication env beh prods cons = case findExactly prods of
959975 anyOfAt beh NoMatchingProperties $
960976 NE.toList pm <&> \(props', madd') -> do
961977 F.for_ (S.fromList $ M.keys props <> M.keys props') $ \k -> do
978+ let beh' = beh >>> step (InProperty k)
979+ go sch sch' = checkCompatibility beh' env (ProdCons sch sch')
962980 case (maybe False propRequired $ M.lookup k props', maybe False propRequired $ M.lookup k props) of
963981 -- producer does not require field, but consumer does (can fail)
964− (False, True) -> issueAt beh (PropertyNowRequired k)
965− _ -> do
966− let go sch sch' = checkCompatibility (beh >>> step (InProperty k)) env (ProdCons sch sch')
967− case (M.lookup k props', madd', M.lookup k props, madd) of
968− -- (producer, additional producer, consumer, additional consumer)
969− (Nothing, Nothing, _, _) -> pure () -- vacuously
970− -- this ^ seems fishy. Producer does not produce anything, but consumer might expect a field.
971− (_, _, Nothing, Nothing) -> issueAt beh (UnexpectedProperty k)
972− (Just p', _, Just p, _) -> go (propRefSchema p') (propRefSchema p)
973− (Nothing, Just add', Just p, _) -> go add' (propRefSchema p)
974− (Just p', _, Nothing, Just add) -> go (propRefSchema p') add
975− (Nothing, Just _, Nothing, Just _) -> pure ()
982+ (False, True) -> issueAt beh' PropertyNowRequired
983+ _ -> pure ()
984+ case (M.lookup k props', madd', M.lookup k props, madd) of
985+ -- (producer, additional producer, consumer, additional consumer)
986+ (Nothing, Nothing, _, _) -> pure () -- vacuously: the producer asserts that this field cannot exist,
987+ -- and the consumer either doesn't require it, or it does and we've already raised an error about it.
988+ (_, _, Nothing, Nothing) -> issueAt beh' UnexpectedProperty
989+ (Just p', _, Just p, _) -> go (propRefSchema p') (propRefSchema p)
990+ (Nothing, Just add', Just p, _) ->
991+ clarifyIssue (AnItem beh' (anIssue AdditionalToProperty)) $
992+ go add' (propRefSchema p)
993+ (Just p', _, Nothing, Just add) ->
994+ clarifyIssue (AnItem beh' (anIssue PropertyToAdditional)) $
995+ go (propRefSchema p') add
996+ (Nothing, Just _, Nothing, Just _) -> pure ()
997+ pure ()
976998 case (madd', madd) of
977999 (Nothing, _) -> pure () -- vacuously
9781000 (_, Nothing) -> issueAt beh NoAdditionalProperties
@@ -1046,10 +1068,6 @@ instance Issuable 'TypedSchemaLevel where
10461068 NoMatchingUniqueItems
10471069 | -- | consumer declares the properties of an object must satisfy some condition, producer doesn't
10481070 NoMatchingProperties
1049− | -- | producer allows a property that is not allowed in the consumer
1050− UnexpectedProperty Text
1051− | -- | consumer requires a property that is not required/allowed in the producer
1052− PropertyNowRequired Text
10531071 | -- | producer allows additional properties, consumer doesn't
10541072 NoAdditionalProperties
10551073 | -- | consumer declares a maximum number of properties in the object ($1), producer doesn't.
@@ -1102,18 +1120,14 @@ instance Issuable 'TypedSchemaLevel where
11021120 describeIssue Backward NoMatchingUniqueItems = para "Items are no longer required to be unique."
11031121 describeIssue Forward NoMatchingProperties = para "Property added."
11041122 describeIssue Backward NoMatchingProperties = para "Property removed."
1105− describeIssue Forward (UnexpectedProperty p) = para $ "Property " <> code p <> " has been removed."
1106− describeIssue Backward (UnexpectedProperty p) = para $ "Property " <> code p <> " has been added."
1107− describeIssue Forward (PropertyNowRequired p) = para $ "Property " <> code p <> " has become required."
1108− describeIssue Backward (PropertyNowRequired p) = para $ "Property " <> code p <> " may not be present."
11091123 describeIssue Forward NoAdditionalProperties = para "Additional properties have been removed."
11101124 describeIssue Backward NoAdditionalProperties = para "Additional properties have been added."
11111125 describeIssue Forward (NoMatchingMaxProperties n) = para $ "Maximum number of properties has been added: " <> show' n <> "."
11121126 describeIssue Backward (NoMatchingMaxProperties n) = para $ "Maximum number of properties has been removed: " <> show' n <> "."
1113− describeIssue _ (MatchingMaxPropertiesWeak (ProdCons p c)) = para $ "Maximum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
1127+ describeIssue _ (MatchingMaxPropertiesWeak (ProdCons p c)) = para $ "Maximum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
11141128 describeIssue Forward (NoMatchingMinProperties n) = para $ "Minimum number of properties added: " <> show' n <> "."
11151129 describeIssue Backward (NoMatchingMinProperties n) = para $ "Minimum number of properties removed: " <> show' n <> "."
1116− describeIssue _ (MatchingMinPropertiesWeak (ProdCons p c)) = para $ "Minimum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
1130+ describeIssue _ (MatchingMinPropertiesWeak (ProdCons p c)) = para $ "Minimum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
11171131 describeIssue _ (NoMatchingCondition conds) =
11181132 para "Expected the following conditions to hold, but they didn't (please file a bug if you see this):"
11191133 <> bulletList ((\(SomeCondition c) -> showCondition c) <$> conds)
@@ -1138,8 +1152,22 @@ instance Issuable 'SchemaLevel where
11381152 InvalidSchema Text
11391153 | -- | The schema contains a reference loop along "anyOf"/"allOf"/"oneOf".
11401154 UnguardedRecursion
1155+ | -- | Producer doesn't place any restrictions on the types, but the consumer does. List what types remain available in the consumer.
1156+ TypesRestricted [JsonType]
1157+ | -- | in the producer this field used to be handled as part of "additionalProperties", and the consumer this is a specific "properties" entry. Only thrown when this change actually causes other issues
1158+ AdditionalToProperty
1159+ | -- | in the consumer this field used to be handled as part of "additionalProperties", and the producer this is a specific "properties" entry. Only thrown when this change actually causes other issues
1160+ PropertyToAdditional
1161+ | -- | consumer requires a property that is not required/allowed in the producer
1162+ PropertyNowRequired
1163+ | -- | producer allows a property that is not allowed in the consumer
1164+ UnexpectedProperty
11411165 deriving stock (Eq, Ord, Show)
1142− issueIsUnsupported _ = True
1166+ issueIsUnsupported = \case
1167+ NotSupported _ -> True
1168+ InvalidSchema _ -> True
1169+ UnguardedRecursion -> True
1170+ _ -> False
11431171
11441172 describeIssue _ (NotSupported i) =
11451173 para (emph "Encountered a feature that OpenApi Diff does not support: " <> text i <> ".")
@@ -1147,6 +1175,20 @@ instance Issuable 'SchemaLevel where
11471175 para (emph "The schema is invalid: " <> text i <> ".")
11481176 describeIssue _ UnguardedRecursion =
11491177 para "Encountered recursion that is too complex for OpenApi Diff to untangle."
1178+ describeIssue Forward (TypesRestricted tys) = case tys of
1179+ [] -> para "No longer has any valid values." -- weird
1180+ _ -> para "Values are now limited to the following types: " <> bulletList (para . describeJSONType <$> tys)
1181+ describeIssue Backward (TypesRestricted tys) = case tys of
1182+ [] -> para "Any value of any type is now allowed." -- weird
1183+ _ -> para "Values are no longer limited to the following types: " <> bulletList (para . describeJSONType <$> tys)
1184+ describeIssue Forward AdditionalToProperty = para "The property was previously implicitly described by the catch-all \"additional properties\" case. It is now explicitly defined."
1185+ describeIssue Backward AdditionalToProperty = para "The property was previously explicitly defined. It is now implicitly described by the catch-all \"additional properties\" case."
1186+ describeIssue Forward PropertyToAdditional = para "The property was previously explicitly defined. It is now implicitly described by the catch-all \"additional properties\" case."
1187+ describeIssue Backward PropertyToAdditional = para "The property was previously implicitly described by the catch-all \"additional properties\" case. It is now explicitly defined."
1188+ describeIssue Forward PropertyNowRequired = para "The property has become required."
1189+ describeIssue Backward PropertyNowRequired = para "The property may not be present."
1190+ describeIssue Forward UnexpectedProperty = para "The property has been removed."
1191+ describeIssue Backward UnexpectedProperty = para "The property has been added."
11501192
11511193instance Behavable 'SchemaLevel 'TypedSchemaLevel where
11521194 data Behave 'SchemaLevel 'TypedSchemaLevel
test/golden/common/property-removed-additional/report.md+19−5
@@ -2,7 +2,7 @@
22
33| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
44|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 1 | 1 | 0 |
5+| 3 | 3 | 0 |
66
77# <span id="breaking-changes"></span>⚠️ Breaking changes
88
@@ -10,9 +10,16 @@
1010
1111### 📱⬅️ JSON Response – 200
1212
13−#### `$(Object)`
13+#### `$.property2`
1414
15−Property `property2` may not be present.
15+1. Values are no longer limited to the following types:
16+
17+ - Number
18+
19+2. The property was previously explicitly defined. It is now implicitly
20+ described by the catch-all "additional properties" case.
21+
22+3. The property may not be present.
1623
1724# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
1825
@@ -20,6 +27,13 @@ Property `property2` may not be present.
2027
2128### 📱➡️ JSON Request
2229
23−#### `$(Object)`
30+#### `$.property2`
31+
32+1. Values are no longer limited to the following types:
33+
34+ - Number
35+
36+2. The property was previously explicitly defined. It is now implicitly
37+ described by the catch-all "additional properties" case.
2438
25−Property `property2` may not be present.
39+3. The property may not be present.
test/golden/common/property-removed-additional/trace-tree.yaml+10−2
@@ -4,11 +4,19 @@ breakingChanges:
44 WithStatusCode 200:
55 ResponsePayload:
66 PayloadSchema:
7− OfType Object: PropertyNowRequired "property2"
7+ OfType Object:
8+ InProperty "property2":
9+ - TypesRestricted [Number]
10+ - AdditionalToProperty
11+ - PropertyNowRequired
812nonBreakingChanges:
913 AtPath "/test":
1014 InOperation PostMethod:
1115 InRequest:
1216 InPayload:
1317 PayloadSchema:
14− OfType Object: PropertyNowRequired "property2"
18+ OfType Object:
19+ InProperty "property2":
20+ - TypesRestricted [Number]
21+ - AdditionalToProperty
22+ - PropertyNowRequired
test/golden/common/property-removed/report.md+8−8
@@ -10,15 +10,15 @@
1010
1111### 📱➡️ JSON Request
1212
13−#### `$(Object)`
13+#### `$.property2`
1414
15−Property `property2` has been removed.
15+The property has been removed.
1616
1717### 📱⬅️ JSON Response – 200
1818
19−#### `$(Object)`
19+#### `$.property2`
2020
21−Property `property2` may not be present.
21+The property may not be present.
2222
2323# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
2424
@@ -26,12 +26,12 @@ Property `property2` may not be present.
2626
2727### 📱➡️ JSON Request
2828
29−#### `$(Object)`
29+#### `$.property2`
3030
31−Property `property2` may not be present.
31+The property may not be present.
3232
3333### 📱⬅️ JSON Response – 200
3434
35−#### `$(Object)`
35+#### `$.property2`
3636
37−Property `property2` has been removed.
37+The property has been removed.
test/golden/common/property-removed/trace-tree.yaml+8−4
@@ -4,19 +4,23 @@ breakingChanges:
44 InRequest:
55 InPayload:
66 PayloadSchema:
7− OfType Object: UnexpectedProperty "property2"
7+ OfType Object:
8+ InProperty "property2": UnexpectedProperty
89 WithStatusCode 200:
910 ResponsePayload:
1011 PayloadSchema:
11− OfType Object: PropertyNowRequired "property2"
12+ OfType Object:
13+ InProperty "property2": PropertyNowRequired
1214nonBreakingChanges:
1315 AtPath "/test":
1416 InOperation PostMethod:
1517 InRequest:
1618 InPayload:
1719 PayloadSchema:
18− OfType Object: PropertyNowRequired "property2"
20+ OfType Object:
21+ InProperty "property2": PropertyNowRequired
1922 WithStatusCode 200:
2023 ResponsePayload:
2124 PayloadSchema:
22− OfType Object: UnexpectedProperty "property2"
25+ OfType Object:
26+ InProperty "property2": UnexpectedProperty
test/golden/common/property-required/report.md+4−4
@@ -10,9 +10,9 @@
1010
1111### 📱➡️ JSON Request
1212
13−#### `$(Object)`
13+#### `$.property2`
1414
15−Property `property2` has become required.
15+The property has become required.
1616
1717# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
1818
@@ -20,6 +20,6 @@ Property `property2` has become required.
2020
2121### 📱⬅️ JSON Response – 200
2222
23−#### `$(Object)`
23+#### `$.property2`
2424
25−Property `property2` has become required.
25+The property has become required.
test/golden/common/property-required/trace-tree.yaml+4−2
@@ -4,11 +4,13 @@ breakingChanges:
44 InRequest:
55 InPayload:
66 PayloadSchema:
7− OfType Object: PropertyNowRequired "property2"
7+ OfType Object:
8+ InProperty "property2": PropertyNowRequired
89nonBreakingChanges:
910 AtPath "/test":
1011 InOperation PostMethod:
1112 WithStatusCode 200:
1213 ResponsePayload:
1314 PayloadSchema:
14− OfType Object: PropertyNowRequired "property2"
15+ OfType Object:
16+ InProperty "property2": PropertyNowRequired
test/golden/common/type-changing/a.yamlnew file+113
@@ -0,0 +1,113 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test1:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test1"
15+ responses:
16+ "200":
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test1"
22+ /test2:
23+ post:
24+ requestBody:
25+ content:
26+ application/json:
27+ schema:
28+ $ref: "#/components/schemas/Test2"
29+ responses:
30+ "200":
31+ description: test
32+ content:
33+ application/json:
34+ schema:
35+ $ref: "#/components/schemas/Test2"
36+ /test3:
37+ post:
38+ requestBody:
39+ content:
40+ application/json:
41+ schema:
42+ $ref: "#/components/schemas/Test3"
43+ responses:
44+ "200":
45+ description: test
46+ content:
47+ application/json:
48+ schema:
49+ $ref: "#/components/schemas/Test3"
50+ /test4:
51+ post:
52+ requestBody:
53+ content:
54+ application/json:
55+ schema:
56+ $ref: "#/components/schemas/Test4"
57+ responses:
58+ "200":
59+ description: test
60+ content:
61+ application/json:
62+ schema:
63+ $ref: "#/components/schemas/Test4"
64+ /test5:
65+ post:
66+ requestBody:
67+ content:
68+ application/json:
69+ schema:
70+ $ref: "#/components/schemas/Test5"
71+ responses:
72+ "200":
73+ description: test
74+ content:
75+ application/json:
76+ schema:
77+ $ref: "#/components/schemas/Test5"
78+components:
79+ schemas:
80+ Test1:
81+ multipleOf: 1
82+ minLength: 1
83+ minItems: 1
84+ Test2:
85+ multipleOf: 1
86+ minLength: 1
87+ minItems: 1
88+ Test3:
89+ anyOf:
90+ - type: number
91+ multipleOf: 1
92+ - type: array
93+ minItems: 1
94+ - type: string
95+ minLength: 1
96+ - type: object
97+ Test4:
98+ anyOf:
99+ - type: number
100+ multipleOf: 1
101+ - type: array
102+ minItems: 1
103+ - type: string
104+ minLength: 1
105+ - type: object
106+ Test5:
107+ anyOf:
108+ - type: number
109+ multipleOf: 1
110+ - type: array
111+ minItems: 1
112+ - type: object
113+ - minLength: 1
test/golden/common/type-changing/b.yamlnew file+108
@@ -0,0 +1,108 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test1:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test1"
15+ responses:
16+ "200":
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test1"
22+ /test2:
23+ post:
24+ requestBody:
25+ content:
26+ application/json:
27+ schema:
28+ $ref: "#/components/schemas/Test2"
29+ responses:
30+ "200":
31+ description: test
32+ content:
33+ application/json:
34+ schema:
35+ $ref: "#/components/schemas/Test2"
36+ /test3:
37+ post:
38+ requestBody:
39+ content:
40+ application/json:
41+ schema:
42+ $ref: "#/components/schemas/Test3"
43+ responses:
44+ "200":
45+ description: test
46+ content:
47+ application/json:
48+ schema:
49+ $ref: "#/components/schemas/Test3"
50+ /test4:
51+ post:
52+ requestBody:
53+ content:
54+ application/json:
55+ schema:
56+ $ref: "#/components/schemas/Test4"
57+ responses:
58+ "200":
59+ description: test
60+ content:
61+ application/json:
62+ schema:
63+ $ref: "#/components/schemas/Test4"
64+ /test5:
65+ post:
66+ requestBody:
67+ content:
68+ application/json:
69+ schema:
70+ $ref: "#/components/schemas/Test5"
71+ responses:
72+ "200":
73+ description: test
74+ content:
75+ application/json:
76+ schema:
77+ $ref: "#/components/schemas/Test5"
78+components:
79+ schemas:
80+ Test1:
81+ type: array
82+ minItems: 1
83+ Test2:
84+ anyOf:
85+ - type: number
86+ multipleOf: 1
87+ - type: array
88+ minItems: 1
89+ - type: object
90+ Test3:
91+ anyOf:
92+ - type: number
93+ multipleOf: 1
94+ - type: string
95+ minLength: 1
96+ - type: object
97+ Test4:
98+ anyOf:
99+ - type: number
100+ multipleOf: 1
101+ - type: array
102+ minItems: 1
103+ - type: string
104+ minLength: 1
105+ Test5:
106+ anyOf:
107+ - type: number
108+ multipleOf: 1
test/golden/common/type-changing/report.mdnew file+105
@@ -0,0 +1,105 @@
1+# Summary
2+
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5+| 6 | 6 | 0 |
6+
7+# <span id="breaking-changes"></span>⚠️ Breaking changes
8+
9+## **POST** /test1
10+
11+### 📱➡️ JSON Request
12+
13+Values are now limited to the following types:
14+
15+- Array
16+
17+## **POST** /test2
18+
19+### 📱➡️ JSON Request
20+
21+Values are now limited to the following types:
22+
23+- Number
24+
25+- Array
26+
27+- Object
28+
29+## **POST** /test3
30+
31+### 📱➡️ JSON Request
32+
33+#### `$(Array)`
34+
35+The type has been removed.
36+
37+## **POST** /test4
38+
39+### 📱➡️ JSON Request
40+
41+#### `$(Object)`
42+
43+The type has been removed.
44+
45+## **POST** /test5
46+
47+### 📱➡️ JSON Request
48+
49+Values are now limited to the following types:
50+
51+- Number
52+
53+#### `$(Number)`
54+
55+Value is now a multiple of 1.0.
56+
57+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
58+
59+## **POST** /test1
60+
61+### 📱⬅️ JSON Response – 200
62+
63+Values are now limited to the following types:
64+
65+- Array
66+
67+## **POST** /test2
68+
69+### 📱⬅️ JSON Response – 200
70+
71+Values are now limited to the following types:
72+
73+- Number
74+
75+- Array
76+
77+- Object
78+
79+## **POST** /test3
80+
81+### 📱⬅️ JSON Response – 200
82+
83+#### `$(Array)`
84+
85+The type has been removed.
86+
87+## **POST** /test4
88+
89+### 📱⬅️ JSON Response – 200
90+
91+#### `$(Object)`
92+
93+The type has been removed.
94+
95+## **POST** /test5
96+
97+### 📱⬅️ JSON Response – 200
98+
99+Values are now limited to the following types:
100+
101+- Number
102+
103+#### `$(Number)`
104+
105+Value is now a multiple of 1.0.
test/golden/common/type-changing/trace-tree.yamlnew file+60
@@ -0,0 +1,60 @@
1+breakingChanges:
2+ AtPath "/test5":
3+ InOperation PostMethod:
4+ InRequest:
5+ InPayload:
6+ PayloadSchema:
7+ - TypesRestricted [Number]
8+ - OfType Number: NoMatchingMultipleOf 1.0
9+ AtPath "/test3":
10+ InOperation PostMethod:
11+ InRequest:
12+ InPayload:
13+ PayloadSchema:
14+ OfType Array: NoContradiction
15+ AtPath "/test4":
16+ InOperation PostMethod:
17+ InRequest:
18+ InPayload:
19+ PayloadSchema:
20+ OfType Object: NoContradiction
21+ AtPath "/test1":
22+ InOperation PostMethod:
23+ InRequest:
24+ InPayload:
25+ PayloadSchema: TypesRestricted [Array]
26+ AtPath "/test2":
27+ InOperation PostMethod:
28+ InRequest:
29+ InPayload:
30+ PayloadSchema: TypesRestricted [Number,Array,Object]
31+nonBreakingChanges:
32+ AtPath "/test5":
33+ InOperation PostMethod:
34+ WithStatusCode 200:
35+ ResponsePayload:
36+ PayloadSchema:
37+ - TypesRestricted [Number]
38+ - OfType Number: NoMatchingMultipleOf 1.0
39+ AtPath "/test3":
40+ InOperation PostMethod:
41+ WithStatusCode 200:
42+ ResponsePayload:
43+ PayloadSchema:
44+ OfType Array: NoContradiction
45+ AtPath "/test4":
46+ InOperation PostMethod:
47+ WithStatusCode 200:
48+ ResponsePayload:
49+ PayloadSchema:
50+ OfType Object: NoContradiction
51+ AtPath "/test1":
52+ InOperation PostMethod:
53+ WithStatusCode 200:
54+ ResponsePayload:
55+ PayloadSchema: TypesRestricted [Array]
56+ AtPath "/test2":
57+ InOperation PostMethod:
58+ WithStatusCode 200:
59+ ResponsePayload:
60+ PayloadSchema: TypesRestricted [Number,Array,Object]