git.iko.soy/typeable/compaREST
on master help sign in
Refactor categorizing issues (#111)
958a653mniip
src/OpenAPI/Checker/Behavior.hs+40−2
@@ -1,11 +1,15 @@
1module OpenAPI.Checker.Behavior
1module OpenAPI.Checker.Behavior
2 ( BehaviorLevel (..)
2 ( BehaviorLevel (..)
3 , Behavable (..)
3 , Behavable (..)
4+ , IssueKind (..)
4 , Issuable (..)
5 , Issuable (..)
5 , Orientation (..)
6 , Orientation (..)
6 , toggleOrientation
7 , toggleOrientation
7 , Behavior
8 , Behavior
8 , AnIssue (..)
9 , AnIssue (..)
10+ , withClass
11+ , anIssueKind
12+ , relatedAnIssues
9 )
13 )
10where
14where
11
15
@@ -39,10 +43,23 @@ class
39 Behavable (a :: BehaviorLevel) (b :: BehaviorLevel)
43 Behavable (a :: BehaviorLevel) (b :: BehaviorLevel)
40 where
44 where
41 data Behave a b
45 data Behave a b
42− describeBehaviour :: Behave a b -> Inlines
46+ describeBehavior :: Behave a b -> Inlines
43
47
44type instance AdditionalQuiverConstraints Behave a b = Behavable a b
48type instance AdditionalQuiverConstraints Behave a b = Behavable a b
45
49
50+data IssueKind
51+ = -- | This is certainly an issue, we can demonstrate a "counterexample"
52+ CertainIssue
53+ | -- | Change looks breaking but we don't have a complete comprehension of the problem
54+ ProbablyIssue
55+ | -- | We don't really support this feature at all, outside structural comparison
56+ Unsupported
57+ | -- | This is not an issue in itself, but a clarifying comment providing context for some other issues
58+ Comment
59+ | -- | We detected an issue with one of the input schemata itself
60+ SchemaInvalid
61+ deriving stock (Eq, Ord, Show)
62+
46class (Typeable l, Ord (Issue l), Show (Issue l)) => Issuable (l :: BehaviorLevel) where
63class (Typeable l, Ord (Issue l), Show (Issue l)) => Issuable (l :: BehaviorLevel) where
47 data Issue l :: Type
64 data Issue l :: Type
48
65
@@ -58,7 +75,22 @@ class (Typeable l, Ord (Issue l), Show (Issue l)) => Issuable (l :: BehaviorLeve
58 -- If _producer_ doesn't have something, the element was "added".
75 -- If _producer_ doesn't have something, the element was "added".
59 describeIssue :: Orientation -> Issue l -> Blocks
76 describeIssue :: Orientation -> Issue l -> Blocks
60
77
61− issueIsUnsupported :: Issue l -> Bool
78+ issueKind :: Issue l -> IssueKind
79+
80+ -- | An equivalence relation designating whether two issues are talking about the aspect of the schema. This is used
81+ -- to remove duplicates from the "reverse" error tree we get when we look for non-breaking changes.
82+ -- Generally if checking X->Y raises issue I, and checking Y->X raises issue J, I and J should be related.
83+ relatedIssues :: Issue l -> Issue l -> Bool
84+ relatedIssues = (==)
85+
86+-- Utility function for 'relatedIssues'. In @withClass eq f@, @f@ attempts to partition inputs into equivalence classes,
87+-- and two items in the same equivalence class are related. If both items aren't assigned to a class by @f@, instead
88+-- @eq@ is used to compare them.
89+withClass :: Eq b => (a -> a -> Bool) -> (a -> Maybe b) -> a -> a -> Bool
90+withClass eq f = \x y -> case (f x, f y) of
91+ (Just fx, Just fy) -> fx == fy
92+ (Nothing, Nothing) -> eq x y
93+ (_, _) -> False
62
94
63data Orientation = Forward | Backward
95data Orientation = Forward | Backward
64 deriving stock (Eq, Ord, Show)
96 deriving stock (Eq, Ord, Show)
@@ -84,3 +116,9 @@ deriving stock instance Ord (AnIssue l)
84
116
85instance ToJSON (AnIssue l) where
117instance ToJSON (AnIssue l) where
86 toJSON (AnIssue _ issue) = toJSON issue
118 toJSON (AnIssue _ issue) = toJSON issue
119+
120+anIssueKind :: AnIssue l -> IssueKind
121+anIssueKind (AnIssue _ i) = issueKind i
122+
123+relatedAnIssues :: AnIssue l -> AnIssue l -> Bool
124+relatedAnIssues (AnIssue _ x) (AnIssue _ y) = relatedIssues x y
src/OpenAPI/Checker/PathsPrefixTree.hs+24−2
@@ -10,7 +10,9 @@ module OpenAPI.Checker.PathsPrefixTree
10 , foldWith
10 , foldWith
11 , toList
11 , toList
12 , filter
12 , filter
13+ , filterWithKey
13 , takeSubtree
14 , takeSubtree
15+ , lookup
14 , embed
16 , embed
15 , size
17 , size
16 , partition
18 , partition
@@ -33,7 +35,7 @@ import qualified Data.Vector as V
33import qualified GHC.Exts as Exts
35import qualified GHC.Exts as Exts
34import OpenAPI.Checker.Paths
36import OpenAPI.Checker.Paths
35import Type.Reflection
37import Type.Reflection
36−import Prelude hiding (filter, map, null)
38+import Prelude hiding (filter, map, null, lookup)
37
39
38-- | A list of @AnItem r f@, but optimized into a prefix tree.
40-- | A list of @AnItem r f@, but optimized into a prefix tree.
39data PathsPrefixTree (q :: k -> k -> Type) (f :: k -> Type) (r :: k) = PathsPrefixTree
41data PathsPrefixTree (q :: k -> k -> Type) (f :: k -> Type) (r :: k) = PathsPrefixTree
@@ -56,10 +58,27 @@ filter f (PathsPrefixTree roots branches) = PathsPrefixTree roots' branches'
56 roots' = filterASet f roots
58 roots' = filterASet f roots
57 branches' =
59 branches' =
58 Exts.fromList
60 Exts.fromList
59− . fmap (\(TRM.WrapTypeable (AStep x)) -> TRM.WrapTypeable . AStep . M.filter (not . null) . fmap (filter f) $ x)
61+ . fmap (\(TRM.WrapTypeable (AStep x)) -> TRM.WrapTypeable . AStep . M.mapMaybe (maybeNonEmpty . filter f) $ x)
60 . Exts.toList
62 . Exts.toList
61 $ branches
63 $ branches
62
64
65+ maybeNonEmpty = mfilter (not . null) . Just
66+
67+filterWithKey :: (forall a. Paths q r a -> f a -> Bool) -> PathsPrefixTree q f r -> PathsPrefixTree q f r
68+filterWithKey = go Root
69+ where
70+ go :: Paths q r b -> (forall a. Paths q r a -> f a -> Bool) -> PathsPrefixTree q f b -> PathsPrefixTree q f b
71+ go xs f (PathsPrefixTree roots branches) = PathsPrefixTree roots' branches'
72+ where
73+ roots' = filterASet (f xs) roots
74+ branches' =
75+ Exts.fromList
76+ . fmap (\(TRM.WrapTypeable (AStep x)) -> TRM.WrapTypeable . AStep . M.mapMaybeWithKey (\k -> maybeNonEmpty . go (xs `Snoc` k) f) $ x)
77+ . Exts.toList
78+ $ branches
79+
80+ maybeNonEmpty = mfilter (not . null) . Just
81+
63-- | The number of leaves.
82-- | The number of leaves.
64size :: PathsPrefixTree q f r -> Int
83size :: PathsPrefixTree q f r -> Int
65size (PathsPrefixTree root branches) =
84size (PathsPrefixTree root branches) =
@@ -225,6 +244,9 @@ takeSubtree (Snoc xs x) t =
225 foldMap (\(AStep m) -> fold $ M.lookup x m) $
244 foldMap (\(AStep m) -> fold $ M.lookup x m) $
226 TRM.lookup @a $ snocItems $ takeSubtree xs t
245 TRM.lookup @a $ snocItems $ takeSubtree xs t
227
246
247+lookup :: Paths q r a -> PathsPrefixTree q f r -> S.Set (f a)
248+lookup xs = toSet . rootItems . takeSubtree xs
249+
228-- | Embed a subtree in a larger tree with given prefix
250-- | Embed a subtree in a larger tree with given prefix
229embed :: Paths q r a -> PathsPrefixTree q f a -> PathsPrefixTree q f r
251embed :: Paths q r a -> PathsPrefixTree q f a -> PathsPrefixTree q f r
230embed Root t = t
252embed Root t = t
src/OpenAPI/Checker/Report.hs+58−22
@@ -1,6 +1,8 @@
1module OpenAPI.Checker.Report
1module OpenAPI.Checker.Report
2 ( generateReport
2 ( generateReport
3+ , CheckerOutput(..)
3 , ReportInput (..)
4 , ReportInput (..)
5+ , segregateIssues
4 , ReportStatus (..)
6 , ReportStatus (..)
5 , Pandoc
7 , Pandoc
6 , ReportConfig (..)
8 , ReportConfig (..)
@@ -43,14 +45,38 @@ import Text.Pandoc.Builder
43
45
44type Changes = P.PathsPrefixTree Behave AnIssue 'APILevel
46type Changes = P.PathsPrefixTree Behave AnIssue 'APILevel
45
47
48+data CheckerOutput = CheckerOutput
49+ { forwardChanges :: Changes
50+ , backwardChanges :: Changes
51+ }
52+ deriving stock (Generic)
53+ deriving (Semigroup, Monoid) via (Generically CheckerOutput)
54+ deriving anyclass (ToJSON)
55+
46data ReportInput = ReportInput
56data ReportInput = ReportInput
47− { breakingChanges :: Changes
57+ { breakingChanges :: Changes -- ^ forward 'CertainIssue', 'ProbablyIssue' and 'Comment'
48− , nonBreakingChanges :: Changes
58+ , nonBreakingChanges :: Changes -- ^ backward 'CertainIssue', 'ProbablyIssue' and 'Comment', except those shadowed by 'relatedIssues'
59+ , unsupportedChanges :: Changes -- ^ forward and backward 'Unsupported' (assumed to be the same anyway)
60+ , schemaIssues :: Changes -- ^ forward and backward 'SchemaInvalid' (assumed to be the same anyway)
49 }
61 }
50 deriving stock (Generic)
62 deriving stock (Generic)
51 deriving (Semigroup, Monoid) via (Generically ReportInput)
63 deriving (Semigroup, Monoid) via (Generically ReportInput)
52 deriving anyclass (ToJSON)
64 deriving anyclass (ToJSON)
53
65
66+segregateIssues :: CheckerOutput -> ReportInput
67+segregateIssues CheckerOutput {forwardChanges = fwd, backwardChanges = bck} = ReportInput
68+ { breakingChanges = P.filter isBreaking fwd
69+ , nonBreakingChanges = invertIssueOrientationP $ P.filterWithKey isNonBreaking bck
70+ , unsupportedChanges = P.filter isUnsupported fwd <> P.filter isUnsupported bck
71+ , schemaIssues = P.filter isSchemaIssue fwd <> P.filter isSchemaIssue bck
72+ }
73+ where
74+ isBreaking i = anIssueKind i `elem` [CertainIssue, ProbablyIssue, Comment]
75+ isNonBreaking :: Paths Behave 'APILevel a -> AnIssue a -> Bool
76+ isNonBreaking xs i = isBreaking i && all (\j -> not $ relatedAnIssues i j) (P.lookup xs fwd)
77+ isUnsupported i = anIssueKind i == Unsupported
78+ isSchemaIssue i = anIssueKind i == SchemaInvalid
79+
54data ReportStatus
80data ReportStatus
55 = BreakingChanges
81 = BreakingChanges
56 | NoBreakingChanges
82 | NoBreakingChanges
@@ -80,13 +106,11 @@ twoRowTable x = simpleTable (para . fst <$> x) [para . snd <$> x]
80
106
81generateReport :: ReportConfig -> ReportInput -> (Pandoc, ReportStatus)
107generateReport :: ReportConfig -> ReportInput -> (Pandoc, ReportStatus)
82generateReport cfg inp =
108generateReport cfg inp =
83− let partitionUnsupported = P.partition (\(AnIssue _ i) -> issueIsUnsupported i)
109+ let
84− (bUnsupported, breaking) = partitionUnsupported $ breakingChanges inp
110+ schemaIssuesPresent = not $ P.null $ schemaIssues inp
85− (nbUnsupported, invertIssueOrientationP -> nonBreaking) = partitionUnsupported $ nonBreakingChanges inp
111+ breakingChangesPresent = not $ P.null $ breakingChanges inp
86− unsupported = bUnsupported <> nbUnsupported
87− breakingChangesPresent = not $ P.null breaking
88− nonBreakingChangesPresent = not $ P.null nonBreaking
112+ nonBreakingChangesPresent = not $ P.null $ nonBreakingChanges inp
89− unsupportedChangesPresent = not $ P.null unsupported
113+ unsupportedChangesPresent = not $ P.null $ unsupportedChanges inp
90 nonBreakingChangesShown = case reportMode cfg of
114 nonBreakingChangesShown = case reportMode cfg of
91 All -> True
115 All -> True
92 OnlyErrors -> False
116 OnlyErrors -> False
@@ -95,32 +119,43 @@ generateReport cfg inp =
95 doc $
119 doc $
96 header 1 "Summary"
120 header 1 "Summary"
97 <> twoRowTable
121 <> twoRowTable
122+ (when'
123+ schemaIssuesPresent
124+ [ ( refOpt schemaIssuesPresent schemaIssuesId "❌ Schema issues"
125+ , show' $ P.size $ schemaIssues inp
126+ )
127+ ]
128+ ++
98− ([ ( refOpt breakingChangesPresent breakingChangesId "⚠️ Breaking changes"
129+ [ ( refOpt breakingChangesPresent breakingChangesId "⚠️ Breaking changes"
99− , show' $ P.size breaking
130+ , show' $ P.size $ breakingChanges inp
100− )
131+ )
101− ]
132+ ]
102 ++ when'
133 ++ when'
103 nonBreakingChangesShown
134 nonBreakingChangesShown
104 [ ( refOpt nonBreakingChangesPresent nonBreakingChangesId "🙆 Non-breaking changes"
135 [ ( refOpt nonBreakingChangesPresent nonBreakingChangesId "🙆 Non-breaking changes"
105− , show' $ P.size nonBreaking
136+ , show' $ P.size $ nonBreakingChanges inp
106 )
137 )
107 ]
138 ]
108 ++ [ ( refOpt unsupportedChangesPresent unsupportedChangesId "🤷 Unsupported feature changes"
139 ++ [ ( refOpt unsupportedChangesPresent unsupportedChangesId "🤷 Unsupported feature changes"
109− , show' $ P.size unsupported
140+ , show' $ P.size $ unsupportedChanges inp
110 )
141 )
111 ])
142 ])
143+ <> when'
144+ schemaIssuesPresent
145+ (header 1 (anchor schemaIssuesId <> "❌ Schema issues")
146+ <> builder (showErrs $ schemaIssues inp))
112 <> when'
147 <> when'
113 breakingChangesPresent
148 breakingChangesPresent
114 (header 1 (anchor breakingChangesId <> "⚠️ Breaking changes")
149 (header 1 (anchor breakingChangesId <> "⚠️ Breaking changes")
115− <> builder (showErrs breaking))
150+ <> builder (showErrs $ breakingChanges inp))
116 <> when'
151 <> when'
117 (nonBreakingChangesPresent && nonBreakingChangesShown)
152 (nonBreakingChangesPresent && nonBreakingChangesShown)
118 (header 1 (anchor nonBreakingChangesId <> "🙆 Non-breaking changes")
153 (header 1 (anchor nonBreakingChangesId <> "🙆 Non-breaking changes")
119− <> builder (showErrs nonBreaking))
154+ <> builder (showErrs $ nonBreakingChanges inp))
120 <> when'
155 <> when'
121 unsupportedChangesPresent
156 unsupportedChangesPresent
122 (header 1 (anchor unsupportedChangesId <> "🤷 Unsupported feature changes")
157 (header 1 (anchor unsupportedChangesId <> "🤷 Unsupported feature changes")
123− <> builder (showErrs unsupported))
158+ <> builder (showErrs $ unsupportedChanges inp))
124 status =
159 status =
125 if
160 if
126 | breakingChangesPresent -> BreakingChanges
161 | breakingChangesPresent -> BreakingChanges
@@ -135,10 +170,11 @@ generateReport cfg inp =
135 refOpt False _ i = i
170 refOpt False _ i = i
136 refOpt True a i = link ("#" <> a) "" i
171 refOpt True a i = link ("#" <> a) "" i
137
172
138− breakingChangesId, nonBreakingChangesId, unsupportedChangesId :: Text
173+ breakingChangesId, nonBreakingChangesId, unsupportedChangesId, schemaIssuesId :: Text
139 breakingChangesId = "breaking-changes"
174 breakingChangesId = "breaking-changes"
140 unsupportedChangesId = "unsupported-changes"
175 unsupportedChangesId = "unsupported-changes"
141 nonBreakingChangesId = "non-breaking-changes"
176 nonBreakingChangesId = "non-breaking-changes"
177+ schemaIssuesId = "schema-issues"
142
178
143 when' :: Monoid m => Bool -> m -> m
179 when' :: Monoid m => Bool -> m -> m
144 when' True m = m
180 when' True m = m
@@ -180,7 +216,7 @@ showErrs x@(P.PathsPrefixNode currentIssues _) =
180 flip foldMap (M.toList m) $ \(bhv, subErrors) ->
216 flip foldMap (M.toList m) $ \(bhv, subErrors) ->
181 if P.null subErrors
217 if P.null subErrors
182 then mempty
218 then mempty
183− else singletonHeader (describeBehaviour bhv) $ showErrs subErrors
219+ else singletonHeader (describeBehavior bhv) $ showErrs subErrors
184 in issues <> paths <> rest
220 in issues <> paths <> rest
185
221
186unfoldFunctions :: forall m a. (Monoid m, Eq a) => a -> [a -> (m, a)] -> (a -> m) -> m
222unfoldFunctions :: forall m a. (Monoid m, Eq a) => a -> [a -> (m, a)] -> (a -> m) -> m
@@ -198,11 +234,11 @@ jets =
198 unwrapReportJetResult
234 unwrapReportJetResult
199 <$> [ constructReportJet $
235 <$> [ constructReportJet $
200 curry $ \case
236 curry $ \case
201− (OfType Object, p@(InPartition _)) -> Just $ describeBehaviour p :: Maybe Inlines
237+ (OfType Object, p@(InPartition _)) -> Just $ describeBehavior p :: Maybe Inlines
202 _ -> Nothing
238 _ -> Nothing
203 , constructReportJet jsonPathJet
239 , constructReportJet jsonPathJet
204 , constructReportJet $ \p@(AtPath _) op@(InOperation _) ->
240 , constructReportJet $ \p@(AtPath _) op@(InOperation _) ->
205− strong (describeBehaviour op) <> " " <> describeBehaviour p :: Inlines
241+ strong (describeBehavior op) <> " " <> describeBehavior p :: Inlines
206 , constructReportJet $ \(WithStatusCode c) ResponsePayload PayloadSchema ->
242 , constructReportJet $ \(WithStatusCode c) ResponsePayload PayloadSchema ->
207 "📱⬅️ JSON Response – " <> str (T.pack . show $ c) :: Inlines
243 "📱⬅️ JSON Response – " <> str (T.pack . show $ c) :: Inlines
208 , constructReportJet $ \InRequest InPayload PayloadSchema -> "📱➡️ JSON Request" :: Inlines
244 , constructReportJet $ \InRequest InPayload PayloadSchema -> "📱➡️ JSON Request" :: Inlines
src/OpenAPI/Checker/Report/Jet.hs+1−1
@@ -23,7 +23,7 @@ import Text.Pandoc.Builder
23-- The term "jet" in this context was introduced in the Urbit project:
23-- The term "jet" in this context was introduced in the Urbit project:
24-- https://urbit.org/docs/vere/jetting/
24-- https://urbit.org/docs/vere/jetting/
25--
25--
26−-- The pattern fits well for simplifying 'Behaviour' tree paths.
26+-- The pattern fits well for simplifying 'Behavior' tree paths.
27class ConstructReportJet x f where
27class ConstructReportJet x f where
28 constructReportJet :: x -> ReportJetResult f (Maybe Inlines)
28 constructReportJet :: x -> ReportJetResult f (Maybe Inlines)
29
29
src/OpenAPI/Checker/Run.hs+5−5
@@ -12,11 +12,11 @@ import OpenAPI.Checker.Report
12import OpenAPI.Checker.Subtree
12import OpenAPI.Checker.Subtree
13import OpenAPI.Checker.Validate.OpenApi ()
13import OpenAPI.Checker.Validate.OpenApi ()
14
14
15−runChecker :: (OpenApi, OpenApi) -> ReportInput
15+runChecker :: (OpenApi, OpenApi) -> CheckerOutput
16runChecker (client, server) =
16runChecker (client, server) =
17− ReportInput
17+ CheckerOutput
18− { breakingChanges = run client server
18+ { forwardChanges = run client server
19− , nonBreakingChanges = run server client
19+ , backwardChanges = run server client
20 }
20 }
21 where
21 where
22 toPC p c =
22 toPC p c =
@@ -27,4 +27,4 @@ runChecker (client, server) =
27 run p c = either id mempty . runCompatFormula . checkCompatibility Root HNil $ toPC p c
27 run p c = either id mempty . runCompatFormula . checkCompatibility Root HNil $ toPC p c
28
28
29runReport :: ReportConfig -> (OpenApi, OpenApi) -> (Pandoc, ReportStatus)
29runReport :: ReportConfig -> (OpenApi, OpenApi) -> (Pandoc, ReportStatus)
30−runReport cfg = generateReport cfg . runChecker
30+runReport cfg = generateReport cfg . segregateIssues . runChecker
src/OpenAPI/Checker/Validate/Header.hs+4−2
@@ -50,7 +50,9 @@ instance Issuable 'HeaderLevel where
50 | NonEmptyHeaderRequired
50 | NonEmptyHeaderRequired
51 | HeaderSchemaRequired
51 | HeaderSchemaRequired
52 deriving stock (Eq, Ord, Show)
52 deriving stock (Eq, Ord, Show)
53− issueIsUnsupported _ = False
53+ issueKind = \case
54+ HeaderSchemaRequired -> ProbablyIssue -- catch-all schema?
55+ _ -> CertainIssue
54 describeIssue Forward RequiredHeaderMissing = para "Header has become required."
56 describeIssue Forward RequiredHeaderMissing = para "Header has become required."
55 describeIssue Backward RequiredHeaderMissing = para "Header is no longer required."
57 describeIssue Backward RequiredHeaderMissing = para "Header is no longer required."
56 describeIssue Forward NonEmptyHeaderRequired = para "The header does not allow empty values anymore."
58 describeIssue Forward NonEmptyHeaderRequired = para "The header does not allow empty values anymore."
@@ -61,4 +63,4 @@ instance Behavable 'HeaderLevel 'SchemaLevel where
61 data Behave 'HeaderLevel 'SchemaLevel
63 data Behave 'HeaderLevel 'SchemaLevel
62 = InSchema
64 = InSchema
63 deriving stock (Eq, Ord, Show)
65 deriving stock (Eq, Ord, Show)
64− describeBehaviour InSchema = "JSON Schema"
66+ describeBehavior InSchema = "JSON Schema"
src/OpenAPI/Checker/Validate/Link.hs+2−2
@@ -17,6 +17,6 @@ instance Issuable 'LinkLevel where
17 data Issue 'LinkLevel
17 data Issue 'LinkLevel
18 = LinksUnsupported
18 = LinksUnsupported
19 deriving stock (Eq, Ord, Show)
19 deriving stock (Eq, Ord, Show)
20− issueIsUnsupported = \case
20+ issueKind = \case
21− LinksUnsupported -> True
21+ LinksUnsupported -> Unsupported
22 describeIssue _ LinksUnsupported = para "OpenApi Diff does not currently support Link Objects."
22 describeIssue _ LinksUnsupported = para "OpenApi Diff does not currently support Link Objects."
src/OpenAPI/Checker/Validate/MediaTypeObject.hs+7−7
@@ -38,9 +38,9 @@ instance Issuable 'PayloadLevel where
38 | MediaEncodingMissing Text
38 | MediaEncodingMissing Text
39 | EncodingNotSupported
39 | EncodingNotSupported
40 deriving stock (Eq, Ord, Show)
40 deriving stock (Eq, Ord, Show)
41− issueIsUnsupported = \case
41+ issueKind = \case
42− EncodingNotSupported -> True
42+ EncodingNotSupported -> Unsupported
43− _ -> False
43+ _ -> CertainIssue
44
44
45 describeIssue _ MediaTypeSchemaRequired = para "Media type expected, but was not specified."
45 describeIssue _ MediaTypeSchemaRequired = para "Media type expected, but was not specified."
46 describeIssue Forward (MediaEncodingMissing enc) = para $ "Media encoding " <> str enc <> " has been removed."
46 describeIssue Forward (MediaEncodingMissing enc) = para $ "Media encoding " <> str enc <> " has been removed."
@@ -51,7 +51,7 @@ instance Behavable 'PayloadLevel 'SchemaLevel where
51 data Behave 'PayloadLevel 'SchemaLevel
51 data Behave 'PayloadLevel 'SchemaLevel
52 = PayloadSchema
52 = PayloadSchema
53 deriving stock (Eq, Ord, Show)
53 deriving stock (Eq, Ord, Show)
54− describeBehaviour PayloadSchema = "JSON Schema"
54+ describeBehavior PayloadSchema = "JSON Schema"
55
55
56instance Subtree MediaTypeObject where
56instance Subtree MediaTypeObject where
57 type SubtreeLevel MediaTypeObject = 'PayloadLevel
57 type SubtreeLevel MediaTypeObject = 'PayloadLevel
@@ -143,7 +143,7 @@ instance Behavable 'OperationLevel 'ResponseLevel where
143 data Behave 'OperationLevel 'ResponseLevel
143 data Behave 'OperationLevel 'ResponseLevel
144 = WithStatusCode HttpStatusCode
144 = WithStatusCode HttpStatusCode
145 deriving stock (Eq, Ord, Show)
145 deriving stock (Eq, Ord, Show)
146− describeBehaviour (WithStatusCode c) = "Response code " <> (fromString . show $ c)
146+ describeBehavior (WithStatusCode c) = "Response code " <> (fromString . show $ c)
147
147
148instance Issuable 'OperationLevel where
148instance Issuable 'OperationLevel where
149 data Issue 'OperationLevel
149 data Issue 'OperationLevel
@@ -152,8 +152,8 @@ instance Issuable 'OperationLevel where
152 | PathFragmentNotMatched Int
152 | PathFragmentNotMatched Int
153 | NoRequestBody
153 | NoRequestBody
154 deriving stock (Eq, Ord, Show)
154 deriving stock (Eq, Ord, Show)
155− issueIsUnsupported = \case
155+ issueKind = \case
156− _ -> False
156+ _ -> CertainIssue
157 describeIssue Forward (ConsumerDoesntHaveResponseCode c) =
157 describeIssue Forward (ConsumerDoesntHaveResponseCode c) =
158 para $ "Response code " <> (str . T.pack . show $ c) <> " has been removed."
158 para $ "Response code " <> (str . T.pack . show $ c) <> " has been removed."
159 describeIssue Backward (ConsumerDoesntHaveResponseCode c) =
159 describeIssue Backward (ConsumerDoesntHaveResponseCode c) =
src/OpenAPI/Checker/Validate/OAuth2Flows.hs+9−4
@@ -103,7 +103,9 @@ instance Issuable 'SecurityRequirementLevel where
103 = SecurityRequirementNotMet
103 = SecurityRequirementNotMet
104 | UndefinedSecurityScheme Text
104 | UndefinedSecurityScheme Text
105 deriving stock (Eq, Ord, Show)
105 deriving stock (Eq, Ord, Show)
106− issueIsUnsupported _ = False
106+ issueKind = \case
107+ SecurityRequirementNotMet -> CertainIssue
108+ UndefinedSecurityScheme _ -> SchemaInvalid
107 describeIssue Forward SecurityRequirementNotMet = para "Security scheme has been removed."
109 describeIssue Forward SecurityRequirementNotMet = para "Security scheme has been removed."
108 describeIssue Backward SecurityRequirementNotMet = para "Security scheme was added."
110 describeIssue Backward SecurityRequirementNotMet = para "Security scheme was added."
109 describeIssue _ (UndefinedSecurityScheme k) = para $ "Security scheme " <> code k <> " is not defined."
111 describeIssue _ (UndefinedSecurityScheme k) = para $ "Security scheme " <> code k <> " is not defined."
@@ -129,11 +131,14 @@ instance Issuable 'SecuritySchemeLevel where
129 | CanNotHaveScopes
131 | CanNotHaveScopes
130 | ScopeNotDefined Text
132 | ScopeNotDefined Text
131 deriving stock (Eq, Ord, Show)
133 deriving stock (Eq, Ord, Show)
132− issueIsUnsupported _ = False
134+ issueKind = \case
135+ CanNotHaveScopes -> SchemaInvalid
136+ ScopeNotDefined _ -> SchemaInvalid
137+ _ -> CertainIssue
133 describeIssue _ RefreshUrlsDontMatch = para "Refresh URL changed."
138 describeIssue _ RefreshUrlsDontMatch = para "Refresh URL changed."
134 describeIssue _ (HttpSchemeTypesDontMatch _ _) = para "HTTP scheme type changed."
139 describeIssue _ (HttpSchemeTypesDontMatch _ _) = para "HTTP scheme type changed."
135 describeIssue _ (ApiKeyParamsDontMatch _ _) = para "API Key parameters changed."
140 describeIssue _ (ApiKeyParamsDontMatch _ _) = para "API Key parameters changed."
136− describeIssue _ (OpenIdConnectUrlsDontMatch _ _) = para "OpenaId Connect URL changed."
141+ describeIssue _ (OpenIdConnectUrlsDontMatch _ _) = para "OpenID Connect URL changed."
137 describeIssue _ (CustomHttpSchemesDontMatch e a) =
142 describeIssue _ (CustomHttpSchemesDontMatch e a) =
138 para $ "Changed HTTP scheme from " <> code e <> " to " <> code a <> "."
143 para $ "Changed HTTP scheme from " <> code e <> " to " <> code a <> "."
139 describeIssue Forward ConsumerDoesNotSupportImplicitFlow = para "Implicit flow support has been removed."
144 describeIssue Forward ConsumerDoesNotSupportImplicitFlow = para "Implicit flow support has been removed."
@@ -162,4 +167,4 @@ instance Behavable 'SecurityRequirementLevel 'SecuritySchemeLevel where
162 data Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
167 data Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
163 = SecuritySchemeStep Text
168 = SecuritySchemeStep Text
164 deriving stock (Eq, Ord, Show)
169 deriving stock (Eq, Ord, Show)
165− describeBehaviour (SecuritySchemeStep s) = text s
170+ describeBehavior (SecuritySchemeStep s) = text s
src/OpenAPI/Checker/Validate/Operation.hs+17−12
@@ -101,21 +101,21 @@ instance Behavable 'OperationLevel 'PathFragmentLevel where
101 = InParam Text
101 = InParam Text
102 | InFragment (PathFragment Text)
102 | InFragment (PathFragment Text)
103 deriving stock (Eq, Ord, Show)
103 deriving stock (Eq, Ord, Show)
104− describeBehaviour (InParam p) = "Parameter " <> text p
104+ describeBehavior (InParam p) = "Parameter " <> text p
105− describeBehaviour (InFragment (StaticPath p)) = "Static fragment " <> code p
105+ describeBehavior (InFragment (StaticPath p)) = "Static fragment " <> code p
106− describeBehaviour (InFragment (DynamicPath p)) = "Dynamic fragment " <> code p
106+ describeBehavior (InFragment (DynamicPath p)) = "Dynamic fragment " <> code p
107
107
108instance Behavable 'OperationLevel 'RequestLevel where
108instance Behavable 'OperationLevel 'RequestLevel where
109 data Behave 'OperationLevel 'RequestLevel
109 data Behave 'OperationLevel 'RequestLevel
110 = InRequest
110 = InRequest
111 deriving stock (Eq, Ord, Show)
111 deriving stock (Eq, Ord, Show)
112− describeBehaviour InRequest = "Request"
112+ describeBehavior InRequest = "Request"
113
113
114instance Behavable 'OperationLevel 'SecurityRequirementLevel where
114instance Behavable 'OperationLevel 'SecurityRequirementLevel where
115 data Behave 'OperationLevel 'SecurityRequirementLevel
115 data Behave 'OperationLevel 'SecurityRequirementLevel
116 = SecurityRequirementStep Int
116 = SecurityRequirementStep Int
117 deriving stock (Eq, Ord, Show)
117 deriving stock (Eq, Ord, Show)
118− describeBehaviour (SecurityRequirementStep i) =
118+ describeBehavior (SecurityRequirementStep i) =
119 "Security requirement " <> (text . T.pack . show $ i)
119 "Security requirement " <> (text . T.pack . show $ i)
120
120
121instance Subtree MatchedOperation where
121instance Subtree MatchedOperation where
@@ -335,7 +335,11 @@ instance Issuable 'APILevel where
335 | AllPathsFailed FilePath
335 | AllPathsFailed FilePath
336 -- When several paths match given but all checks failed
336 -- When several paths match given but all checks failed
337 deriving stock (Eq, Ord, Show)
337 deriving stock (Eq, Ord, Show)
338− issueIsUnsupported _ = False
338+ issueKind = \case
339+ _ -> CertainIssue
340+ relatedIssues = (==) `withClass` \case
341+ NoPathsMatched fp -> Just fp
342+ AllPathsFailed fp -> Just fp
339 describeIssue Forward (NoPathsMatched p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
343 describeIssue Forward (NoPathsMatched p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
340 describeIssue Backward (NoPathsMatched p) = para $ "The path " <> (code . T.pack) p <> " has been added."
344 describeIssue Backward (NoPathsMatched p) = para $ "The path " <> (code . T.pack) p <> " has been added."
341 describeIssue Forward (AllPathsFailed p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
345 describeIssue Forward (AllPathsFailed p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
@@ -346,7 +350,7 @@ instance Behavable 'APILevel 'PathLevel where
346 = AtPath FilePath
350 = AtPath FilePath
347 deriving stock (Eq, Ord, Show)
351 deriving stock (Eq, Ord, Show)
348
352
349− describeBehaviour (AtPath p) = str (T.pack p)
353+ describeBehavior (AtPath p) = str (T.pack p)
350
354
351instance Subtree ProcessedPathItems where
355instance Subtree ProcessedPathItems where
352 type SubtreeLevel ProcessedPathItems = 'APILevel
356 type SubtreeLevel ProcessedPathItems = 'APILevel
@@ -440,7 +444,8 @@ instance Issuable 'PathLevel where
440 data Issue 'PathLevel
444 data Issue 'PathLevel
441 = OperationMissing OperationMethod
445 = OperationMissing OperationMethod
442 deriving stock (Eq, Ord, Show)
446 deriving stock (Eq, Ord, Show)
443− issueIsUnsupported _ = False
447+ issueKind = \case
448+ OperationMissing _ -> CertainIssue
444 describeIssue Forward (OperationMissing op) = para $ "Method " <> strong (showMethod op) <> " has been removed."
449 describeIssue Forward (OperationMissing op) = para $ "Method " <> strong (showMethod op) <> " has been removed."
445 describeIssue Backward (OperationMissing op) = para $ "Method " <> strong (showMethod op) <> " has been added."
450 describeIssue Backward (OperationMissing op) = para $ "Method " <> strong (showMethod op) <> " has been added."
446
451
@@ -449,7 +454,7 @@ instance Behavable 'PathLevel 'OperationLevel where
449 = InOperation OperationMethod
454 = InOperation OperationMethod
450 deriving stock (Eq, Ord, Show)
455 deriving stock (Eq, Ord, Show)
451
456
452− describeBehaviour (InOperation method) = showMethod method
457+ describeBehavior (InOperation method) = showMethod method
453
458
454showMethod :: IsString s => OperationMethod -> s
459showMethod :: IsString s => OperationMethod -> s
455showMethod = \case
460showMethod = \case
@@ -557,8 +562,8 @@ instance Issuable 'CallbackLevel where
557 data Issue 'CallbackLevel
562 data Issue 'CallbackLevel
558 = CallbacksUnsupported
563 = CallbacksUnsupported
559 deriving stock (Eq, Ord, Show)
564 deriving stock (Eq, Ord, Show)
560− issueIsUnsupported = \case
565+ issueKind = \case
561− CallbacksUnsupported -> True
566+ CallbacksUnsupported -> Unsupported
562 describeIssue _ CallbacksUnsupported = para "OpenApi Diff does not currently support callbacks."
567 describeIssue _ CallbacksUnsupported = para "OpenApi Diff does not currently support callbacks."
563
568
564tracedCallbackPathItems :: Traced Callback -> Traced ProcessedPathItems
569tracedCallbackPathItems :: Traced Callback -> Traced ProcessedPathItems
@@ -573,4 +578,4 @@ instance Behavable 'OperationLevel 'CallbackLevel where
573 data Behave 'OperationLevel 'CallbackLevel = OperationCallback Text
578 data Behave 'OperationLevel 'CallbackLevel = OperationCallback Text
574 deriving stock (Eq, Ord, Show)
579 deriving stock (Eq, Ord, Show)
575
580
576− describeBehaviour (OperationCallback key) = "Operation " <> code key
581+ describeBehavior (OperationCallback key) = "Operation " <> code key
src/OpenAPI/Checker/Validate/Param.hs+4−2
@@ -68,7 +68,9 @@ instance Issuable 'PathFragmentLevel where
68 ParamSchemaMismatch
68 ParamSchemaMismatch
69 | PathFragmentsDontMatch (ProdCons Text)
69 | PathFragmentsDontMatch (ProdCons Text)
70 deriving stock (Eq, Ord, Show)
70 deriving stock (Eq, Ord, Show)
71− issueIsUnsupported _ = False
71+ issueKind = \case
72+ ParamSchemaMismatch -> ProbablyIssue -- the schema could be catch-all (?)
73+ _ -> CertainIssue
72 describeIssue _ ParamNameMismatch = para "The path fragments don't match."
74 describeIssue _ ParamNameMismatch = para "The path fragments don't match."
73 describeIssue Forward ParamEmptinessIncompatible = para "The parameter can no longer be empty."
75 describeIssue Forward ParamEmptinessIncompatible = para "The parameter can no longer be empty."
74 describeIssue Backward ParamEmptinessIncompatible = para "The parameter can now be empty."
76 describeIssue Backward ParamEmptinessIncompatible = para "The parameter can now be empty."
@@ -85,7 +87,7 @@ instance Behavable 'PathFragmentLevel 'SchemaLevel where
85 = InParamSchema
87 = InParamSchema
86 deriving stock (Eq, Ord, Show)
88 deriving stock (Eq, Ord, Show)
87
89
88− describeBehaviour InParamSchema = "JSON Schema"
90+ describeBehavior InParamSchema = "JSON Schema"
89
91
90instance Subtree Param where
92instance Subtree Param where
91 type SubtreeLevel Param = 'PathFragmentLevel
93 type SubtreeLevel Param = 'PathFragmentLevel
src/OpenAPI/Checker/Validate/RequestBody.hs+3−2
@@ -30,7 +30,8 @@ instance Issuable 'RequestLevel where
30 = RequestBodyRequired
30 = RequestBodyRequired
31 | RequestMediaTypeNotFound MediaType
31 | RequestMediaTypeNotFound MediaType
32 deriving stock (Eq, Ord, Show)
32 deriving stock (Eq, Ord, Show)
33− issueIsUnsupported _ = False
33+ issueKind = \case
34+ _ -> CertainIssue
34 describeIssue Forward RequestBodyRequired =
35 describeIssue Forward RequestBodyRequired =
35 para "Request body has become required."
36 para "Request body has become required."
36 describeIssue Backward RequestBodyRequired =
37 describeIssue Backward RequestBodyRequired =
@@ -44,7 +45,7 @@ instance Behavable 'RequestLevel 'PayloadLevel where
44 data Behave 'RequestLevel 'PayloadLevel
45 data Behave 'RequestLevel 'PayloadLevel
45 = InPayload
46 = InPayload
46 deriving stock (Eq, Ord, Show)
47 deriving stock (Eq, Ord, Show)
47− describeBehaviour InPayload = "Payload"
48+ describeBehavior InPayload = "Payload"
48
49
49instance Subtree RequestBody where
50instance Subtree RequestBody where
50 type SubtreeLevel RequestBody = 'RequestLevel
51 type SubtreeLevel RequestBody = 'RequestLevel
src/OpenAPI/Checker/Validate/Responses.hs+4−3
@@ -71,7 +71,8 @@ instance Issuable 'ResponseLevel where
71 = ConsumerDoesntHaveMediaType MediaType
71 = ConsumerDoesntHaveMediaType MediaType
72 | ProducerDoesntHaveResponseHeader HeaderName
72 | ProducerDoesntHaveResponseHeader HeaderName
73 deriving stock (Eq, Ord, Show)
73 deriving stock (Eq, Ord, Show)
74− issueIsUnsupported _ = False
74+ issueKind = \case
75+ _ -> CertainIssue
75 describeIssue Forward (ConsumerDoesntHaveMediaType t) =
76 describeIssue Forward (ConsumerDoesntHaveMediaType t) =
76 para $ "Media type was removed: " <> (code . T.pack . show $ t) <> "."
77 para $ "Media type was removed: " <> (code . T.pack . show $ t) <> "."
77 describeIssue Backward (ConsumerDoesntHaveMediaType t) =
78 describeIssue Backward (ConsumerDoesntHaveMediaType t) =
@@ -86,14 +87,14 @@ instance Behavable 'ResponseLevel 'PayloadLevel where
86 = ResponsePayload
87 = ResponsePayload
87 deriving stock (Eq, Ord, Show)
88 deriving stock (Eq, Ord, Show)
88
89
89− describeBehaviour ResponsePayload = "Payload"
90+ describeBehavior ResponsePayload = "Payload"
90
91
91instance Behavable 'ResponseLevel 'HeaderLevel where
92instance Behavable 'ResponseLevel 'HeaderLevel where
92 data Behave 'ResponseLevel 'HeaderLevel
93 data Behave 'ResponseLevel 'HeaderLevel
93 = InHeader HeaderName
94 = InHeader HeaderName
94 deriving stock (Eq, Ord, Show)
95 deriving stock (Eq, Ord, Show)
95
96
96− describeBehaviour (InHeader name) = "Header " <> code name
97+ describeBehavior (InHeader name) = "Header " <> code name
97
98
98instance Subtree Response where
99instance Subtree Response where
99 type SubtreeLevel Response = 'ResponseLevel
100 type SubtreeLevel Response = 'ResponseLevel
src/OpenAPI/Checker/Validate/Schema/Issues.hs+83−14
@@ -87,7 +87,66 @@ instance Issuable 'TypedSchemaLevel where
87 | -- | consumer indicates that no values in a particular partition are allowed, but we weren't able to conclude this in the producer
87 | -- | consumer indicates that no values in a particular partition are allowed, but we weren't able to conclude this in the producer
88 PartitionBecomesEmpty Partition
88 PartitionBecomesEmpty Partition
89 deriving stock (Eq, Ord, Show)
89 deriving stock (Eq, Ord, Show)
90− issueIsUnsupported _ = False
90+ issueKind = \case
91+ NoMatchingEnum _ -> ProbablyIssue
92+ MatchingMaximumWeak _ -> ProbablyIssue -- interplay with MultipleOf could make this not an issue
93+ MatchingMinimumWeak _ -> ProbablyIssue -- ditto
94+ MatchingMultipleOfWeak _ -> ProbablyIssue -- ditto
95+ NoMatchingFormat _ -> Unsupported
96+ NoMatchingPattern _ -> Unsupported
97+ ArrayToTuple -> Comment
98+ TupleToArray -> Comment
99+ NoMatchingProperties -> ProbablyIssue -- TODO: #109
100+ TypeBecomesEmpty -> ProbablyIssue -- TODO: #70
101+ PartitionBecomesEmpty _ -> ProbablyIssue -- ditto
102+ _ -> CertainIssue
103+ relatedIssues = (==) `withClass` \case
104+ EnumDoesntSatisfy v -> Just v
105+ NoMatchingEnum v -> Just v
106+ _ -> Nothing
107+ `withClass` \case
108+ NoMatchingMaximum _ -> Just ()
109+ MatchingMaximumWeak _ -> Just ()
110+ _ -> Nothing
111+ `withClass` \case
112+ NoMatchingMinimum _ -> Just ()
113+ MatchingMinimumWeak _ -> Just ()
114+ _ -> Nothing
115+ `withClass` \case
116+ NoMatchingMultipleOf _ -> Just ()
117+ MatchingMultipleOfWeak _ -> Just ()
118+ _ -> Nothing
119+ `withClass` \case
120+ NoMatchingMaxLength _ -> Just ()
121+ MatchingMaxLengthWeak _ -> Just ()
122+ _ -> Nothing
123+ `withClass` \case
124+ NoMatchingMinLength _ -> Just ()
125+ MatchingMinLengthWeak _ -> Just ()
126+ _ -> Nothing
127+ `withClass` \case
128+ NoMatchingItems -> Just ()
129+ ArrayToTuple -> Just ()
130+ TupleToArray -> Just ()
131+ NoMatchingTupleItems -> Just ()
132+ TupleItemsLengthChanged _ -> Just ()
133+ _ -> Nothing
134+ `withClass` \case
135+ NoMatchingMaxItems _ -> Just ()
136+ MatchingMaxItemsWeak _ -> Just ()
137+ _ -> Nothing
138+ `withClass` \case
139+ NoMatchingMinItems _ -> Just ()
140+ MatchingMinItemsWeak _ -> Just ()
141+ _ -> Nothing
142+ `withClass` \case
143+ NoMatchingMaxProperties _ -> Just ()
144+ MatchingMaxPropertiesWeak _ -> Just ()
145+ _ -> Nothing
146+ `withClass` \case
147+ NoMatchingMinProperties _ -> Just ()
148+ MatchingMinPropertiesWeak _ -> Just ()
149+ _ -> Nothing
91 describeIssue Forward (EnumDoesntSatisfy v) = para "The following enum value was removed:" <> showJSONValue v
150 describeIssue Forward (EnumDoesntSatisfy v) = para "The following enum value was removed:" <> showJSONValue v
92 describeIssue Backward (EnumDoesntSatisfy v) = para "The following enum value was added:" <> showJSONValue v
151 describeIssue Backward (EnumDoesntSatisfy v) = para "The following enum value was added:" <> showJSONValue v
93 describeIssue Forward (NoMatchingEnum v) = para "The following enum value has been added:" <> showJSONValue v
152 describeIssue Forward (NoMatchingEnum v) = para "The following enum value has been added:" <> showJSONValue v
@@ -186,13 +245,23 @@ instance Issuable 'SchemaLevel where
186 | -- | producer allows a property that is not allowed in the consumer
245 | -- | producer allows a property that is not allowed in the consumer
187 UnexpectedProperty
246 UnexpectedProperty
188 deriving stock (Eq, Ord, Show)
247 deriving stock (Eq, Ord, Show)
189− issueIsUnsupported = \case
248+ issueKind = \case
190− NotSupported _ -> True
249+ NotSupported _ -> Unsupported
191− OneOfNotDisjoint -> True
250+ OneOfNotDisjoint -> Unsupported
192− InvalidSchema _ -> True
251+ InvalidSchema _ -> SchemaInvalid
193− UnguardedRecursion -> True
252+ UnguardedRecursion -> Unsupported
194− _ -> False
253+ AdditionalToProperty -> Comment
195−
254+ PropertyToAdditional -> Comment
255+ TypesRestricted _ -> ProbablyIssue -- TODO: #70
256+ _ -> CertainIssue
257+ relatedIssues = (==) `withClass` \case
258+ AdditionalToProperty -> Just ()
259+ PropertyToAdditional -> Just ()
260+ _ -> Nothing
261+ `withClass` \case
262+ PropertyNowRequired -> Just ()
263+ UnexpectedProperty -> Just ()
264+ _ -> Nothing
196 describeIssue _ (NotSupported i) =
265 describeIssue _ (NotSupported i) =
197 para (emph "Encountered a feature that OpenApi Diff does not support: " <> text i <> ".")
266 para (emph "Encountered a feature that OpenApi Diff does not support: " <> text i <> ".")
198 describeIssue _ OneOfNotDisjoint =
267 describeIssue _ OneOfNotDisjoint =
@@ -227,14 +296,14 @@ instance Behavable 'SchemaLevel 'TypedSchemaLevel where
227 = OfType JsonType
296 = OfType JsonType
228 deriving stock (Eq, Ord, Show)
297 deriving stock (Eq, Ord, Show)
229
298
230− describeBehaviour (OfType t) = describeJSONType t
299+ describeBehavior (OfType t) = describeJSONType t
231
300
232instance Behavable 'TypedSchemaLevel 'TypedSchemaLevel where
301instance Behavable 'TypedSchemaLevel 'TypedSchemaLevel where
233 data Behave 'TypedSchemaLevel 'TypedSchemaLevel
302 data Behave 'TypedSchemaLevel 'TypedSchemaLevel
234 = InPartition Partition
303 = InPartition Partition
235 deriving stock (Eq, Ord, Show)
304 deriving stock (Eq, Ord, Show)
236
305
237− describeBehaviour (InPartition partition) = "In cases where " <> showPartition partition
306+ describeBehavior (InPartition partition) = "In cases where " <> showPartition partition
238
307
239instance Behavable 'TypedSchemaLevel 'SchemaLevel where
308instance Behavable 'TypedSchemaLevel 'SchemaLevel where
240 data Behave 'TypedSchemaLevel 'SchemaLevel
309 data Behave 'TypedSchemaLevel 'SchemaLevel
@@ -244,7 +313,7 @@ instance Behavable 'TypedSchemaLevel 'SchemaLevel where
244 | InAdditionalProperty
313 | InAdditionalProperty
245 deriving stock (Eq, Ord, Show)
314 deriving stock (Eq, Ord, Show)
246
315
247− describeBehaviour InItems = "Items"
316+ describeBehavior InItems = "Items"
248− describeBehaviour (InItem i) = "Item " <> show' i
317+ describeBehavior (InItem i) = "Item " <> show' i
249− describeBehaviour (InProperty p) = "Property " <> code p
318+ describeBehavior (InProperty p) = "Property " <> code p
250− describeBehaviour InAdditionalProperty = "Additional properties"
319+ describeBehavior InAdditionalProperty = "Additional properties"
src/OpenAPI/Checker/Validate/Server.hs+4−2
@@ -46,7 +46,7 @@ instance Behavable 'OperationLevel 'ServerLevel where
46 = InServer Text
46 = InServer Text
47 deriving stock (Eq, Ord, Show)
47 deriving stock (Eq, Ord, Show)
48
48
49− describeBehaviour (InServer n) = "Server " <> code n
49+ describeBehavior (InServer n) = "Server " <> code n
50
50
51instance Subtree [Server] where
51instance Subtree [Server] where
52 type SubtreeLevel [Server] = 'OperationLevel
52 type SubtreeLevel [Server] = 'OperationLevel
@@ -133,7 +133,9 @@ instance Issuable 'ServerLevel where
133 | ServerVariableNotDefined Text
133 | ServerVariableNotDefined Text
134 | ServerNotMatched
134 | ServerNotMatched
135 deriving stock (Eq, Ord, Show)
135 deriving stock (Eq, Ord, Show)
136− issueIsUnsupported _ = False
136+ issueKind = \case
137+ ServerVariableNotDefined _ -> SchemaInvalid
138+ _ -> CertainIssue
137 describeIssue Forward (EnumValueNotConsumed _ v) =
139 describeIssue Forward (EnumValueNotConsumed _ v) =
138 para $ "Enum value " <> code v <> " has been removed."
140 para $ "Enum value " <> code v <> " has been removed."
139 describeIssue Backward (EnumValueNotConsumed _ v) =
141 describeIssue Backward (EnumValueNotConsumed _ v) =
test/golden/common/bad-oneof-unchanged/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -7,7 +7,7 @@ breakingChanges:
7 WithStatusCode 200:
7 WithStatusCode 200:
8 ResponsePayload:
8 ResponsePayload:
9 PayloadSchema: OneOfNotDisjoint
9 PayloadSchema: OneOfNotDisjoint
10−nonBreakingChanges:
10+backwardChanges:
11 AtPath "/test":
11 AtPath "/test":
12 InOperation PostMethod:
12 InOperation PostMethod:
13 InRequest:
13 InRequest:
test/golden/common/enum-added/trace-tree.yaml+2−2
@@ -1,11 +1,11 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200:
4 WithStatusCode 200:
5 ResponsePayload:
5 ResponsePayload:
6 PayloadSchema:
6 PayloadSchema:
7 OfType String: EnumDoesntSatisfy (String "C")
7 OfType String: EnumDoesntSatisfy (String "C")
8−nonBreakingChanges:
8+backwardChanges:
9 AtPath "/test":
9 AtPath "/test":
10 InOperation PostMethod:
10 InOperation PostMethod:
11 InRequest:
11 InRequest:
test/golden/common/enum-anyof/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/id/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/json/recursive/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/maximum-lowered/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -6,7 +6,7 @@ breakingChanges:
6 PayloadSchema:
6 PayloadSchema:
7 OfType Number: MatchingMaximumWeak (ProdCons {producer = Inclusive 3.0,
7 OfType Number: MatchingMaximumWeak (ProdCons {producer = Inclusive 3.0,
8 consumer = Inclusive 2.0})
8 consumer = Inclusive 2.0})
9−nonBreakingChanges:
9+backwardChanges:
10 AtPath "/test":
10 AtPath "/test":
11 InOperation PostMethod:
11 InOperation PostMethod:
12 WithStatusCode 200:
12 WithStatusCode 200:
test/golden/common/pathItem/operation/parameters/allowEmptyValue/reset/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InParam "test1": ParamEmptinessIncompatible
4 InParam "test1": ParamEmptinessIncompatible
5−nonBreakingChanges: {}
5+backwardChanges: {}
test/golden/common/pathItem/operation/parameters/allowEmptyValue/set/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod:
4 InOperation PostMethod:
5 InParam "test1": ParamEmptinessIncompatible
5 InParam "test1": ParamEmptinessIncompatible
test/golden/common/pathItem/operation/parameters/change/trace-tree.yaml+2−2
@@ -1,10 +1,10 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InParam "test":
4 InParam "test":
5 InParamSchema:
5 InParamSchema:
6 OfType String: TypeBecomesEmpty
6 OfType String: TypeBecomesEmpty
7−nonBreakingChanges:
7+backwardChanges:
8 AtPath "/test":
8 AtPath "/test":
9 InOperation PostMethod:
9 InOperation PostMethod:
10 InParam "test":
10 InParam "test":
test/golden/common/pathItem/operation/parameters/required/false/add/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/pathItem/operation/parameters/required/false/del/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/pathItem/operation/parameters/required/reset/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod:
4 InOperation PostMethod:
5 InParam "test1": ParamRequired
5 InParam "test1": ParamRequired
test/golden/common/pathItem/operation/parameters/required/set/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InParam "test1": ParamRequired
4 InParam "test1": ParamRequired
5−nonBreakingChanges: {}
5+backwardChanges: {}
test/golden/common/pathItem/operation/parameters/required/true/add/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod: ParamNotMatched "test2"
3 InOperation PostMethod: ParamNotMatched "test2"
4−nonBreakingChanges: {}
4+backwardChanges: {}
test/golden/common/pathItem/operation/parameters/required/true/del/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod: ParamNotMatched "test2"
4 InOperation PostMethod: ParamNotMatched "test2"
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/add/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod:
4 InOperation PostMethod:
5 InRequest: RequestMediaTypeNotFound application/x-www-form-urlencoded
5 InRequest: RequestMediaTypeNotFound application/x-www-form-urlencoded
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/change/trace-tree.yaml+2−2
@@ -1,11 +1,11 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
5 InPayload:
5 InPayload:
6 PayloadSchema:
6 PayloadSchema:
7 OfType String: TypeBecomesEmpty
7 OfType String: TypeBecomesEmpty
8−nonBreakingChanges:
8+backwardChanges:
9 AtPath "/test":
9 AtPath "/test":
10 InOperation PostMethod:
10 InOperation PostMethod:
11 InRequest:
11 InRequest:
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/del/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest: RequestMediaTypeNotFound application/x-www-form-urlencoded
4 InRequest: RequestMediaTypeNotFound application/x-www-form-urlencoded
5−nonBreakingChanges: {}
5+backwardChanges: {}
test/golden/common/pathItem/operation/requestBody/required/reset/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod:
4 InOperation PostMethod:
5 InRequest: RequestBodyRequired
5 InRequest: RequestBodyRequired
test/golden/common/pathItem/operation/requestBody/required/set/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest: RequestBodyRequired
4 InRequest: RequestBodyRequired
5−nonBreakingChanges: {}
5+backwardChanges: {}
test/golden/common/pathItem/operation/responses/add/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod: ConsumerDoesntHaveResponseCode 500
3 InOperation PostMethod: ConsumerDoesntHaveResponseCode 500
4−nonBreakingChanges: {}
4+backwardChanges: {}
test/golden/common/pathItem/operation/responses/change/headers/mandatory/add/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod:
4 InOperation PostMethod:
5 WithStatusCode 200: ProducerDoesntHaveResponseHeader "Test2"
5 WithStatusCode 200: ProducerDoesntHaveResponseHeader "Test2"
test/golden/common/pathItem/operation/responses/change/headers/mandatory/del/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200: ProducerDoesntHaveResponseHeader "Test2"
4 WithStatusCode 200: ProducerDoesntHaveResponseHeader "Test2"
5−nonBreakingChanges: {}
5+backwardChanges: {}
test/golden/common/pathItem/operation/responses/change/headers/optional/add/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/pathItem/operation/responses/change/headers/optional/del/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/add/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200: ConsumerDoesntHaveMediaType application/x-www-form-urlencoded
4 WithStatusCode 200: ConsumerDoesntHaveMediaType application/x-www-form-urlencoded
5−nonBreakingChanges: {}
5+backwardChanges: {}
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/change/trace-tree.yaml+2−2
@@ -1,11 +1,11 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200:
4 WithStatusCode 200:
5 ResponsePayload:
5 ResponsePayload:
6 PayloadSchema:
6 PayloadSchema:
7 OfType Number: TypeBecomesEmpty
7 OfType Number: TypeBecomesEmpty
8−nonBreakingChanges:
8+backwardChanges:
9 AtPath "/test":
9 AtPath "/test":
10 InOperation PostMethod:
10 InOperation PostMethod:
11 WithStatusCode 200:
11 WithStatusCode 200:
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/del/trace-tree.yaml+2−2
@@ -1,5 +1,5 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod:
4 InOperation PostMethod:
5 WithStatusCode 200: ConsumerDoesntHaveMediaType application/x-www-form-urlencoded
5 WithStatusCode 200: ConsumerDoesntHaveMediaType application/x-www-form-urlencoded
test/golden/common/pathItem/operation/responses/del/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges:
2+backwardChanges:
3 AtPath "/test":
3 AtPath "/test":
4 InOperation PostMethod: ConsumerDoesntHaveResponseCode 500
4 InOperation PostMethod: ConsumerDoesntHaveResponseCode 500
test/golden/common/property-removed-additional/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200:
4 WithStatusCode 200:
@@ -9,7 +9,7 @@ breakingChanges:
9 - TypesRestricted [Number]
9 - TypesRestricted [Number]
10 - AdditionalToProperty
10 - AdditionalToProperty
11 - PropertyNowRequired
11 - PropertyNowRequired
12−nonBreakingChanges:
12+backwardChanges:
13 AtPath "/test":
13 AtPath "/test":
14 InOperation PostMethod:
14 InOperation PostMethod:
15 InRequest:
15 InRequest:
test/golden/common/property-removed/report.md+3−19
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 2 | 2 | 0 |
5+| 2 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -19,19 +19,3 @@ The property has been removed.
19#### `$.property2`
19#### `$.property2`
20
20
21The property may not be present.
21The property may not be present.
22−
23−# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
24−
25−## **POST** /test
26−
27−### 📱➡️ JSON Request
28−
29−#### `$.property2`
30−
31−The property may not be present.
32−
33−### 📱⬅️ JSON Response – 200
34−
35−#### `$.property2`
36−
37−The property has been removed.
test/golden/common/property-removed/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -11,7 +11,7 @@ breakingChanges:
11 PayloadSchema:
11 PayloadSchema:
12 OfType Object:
12 OfType Object:
13 InProperty "property2": PropertyNowRequired
13 InProperty "property2": PropertyNowRequired
14−nonBreakingChanges:
14+backwardChanges:
15 AtPath "/test":
15 AtPath "/test":
16 InOperation PostMethod:
16 InOperation PostMethod:
17 InRequest:
17 InRequest:
test/golden/common/property-required/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -6,7 +6,7 @@ breakingChanges:
6 PayloadSchema:
6 PayloadSchema:
7 OfType Object:
7 OfType Object:
8 InProperty "property2": PropertyNowRequired
8 InProperty "property2": PropertyNowRequired
9−nonBreakingChanges:
9+backwardChanges:
10 AtPath "/test":
10 AtPath "/test":
11 InOperation PostMethod:
11 InOperation PostMethod:
12 WithStatusCode 200:
12 WithStatusCode 200:
test/golden/common/random-example/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/pets":
2 AtPath "/pets":
3 InOperation GetMethod:
3 InOperation GetMethod:
4 WithStatusCode 200:
4 WithStatusCode 200:
@@ -20,7 +20,7 @@ breakingChanges:
20 - TypesRestricted [Number]
20 - TypesRestricted [Number]
21 - AdditionalToProperty
21 - AdditionalToProperty
22 - OfType Number: NoMatchingMultipleOf 1.0
22 - OfType Number: NoMatchingMultipleOf 1.0
23−nonBreakingChanges:
23+backwardChanges:
24 AtPath "/pets":
24 AtPath "/pets":
25 InOperation GetMethod:
25 InOperation GetMethod:
26 WithStatusCode 200:
26 WithStatusCode 200:
test/golden/common/recursive/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/api/foo":
2 AtPath "/api/foo":
3 InOperation GetMethod:
3 InOperation GetMethod:
4 InRequest:
4 InRequest:
@@ -11,7 +11,7 @@ breakingChanges:
11 OfType Object:
11 OfType Object:
12 InProperty "foo":
12 InProperty "foo":
13 OfType String: NoMatchingEnum (String "a")
13 OfType String: NoMatchingEnum (String "a")
14−nonBreakingChanges:
14+backwardChanges:
15 AtPath "/api/foo":
15 AtPath "/api/foo":
16 InOperation GetMethod:
16 InOperation GetMethod:
17 WithStatusCode 200:
17 WithStatusCode 200:
test/golden/common/security-scheme/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/oauth/sign_out":
2 AtPath "/oauth/sign_out":
3 InOperation GetMethod:
3 InOperation GetMethod:
4 SecurityRequirementStep 1:
4 SecurityRequirementStep 1:
@@ -7,7 +7,7 @@ breakingChanges:
7 InOperation PostMethod:
7 InOperation PostMethod:
8 SecurityRequirementStep 0:
8 SecurityRequirementStep 0:
9 SecuritySchemeStep "oauth": SecuritySchemeNotMatched
9 SecuritySchemeStep "oauth": SecuritySchemeNotMatched
10−nonBreakingChanges:
10+backwardChanges:
11 AtPath "/oauth/check":
11 AtPath "/oauth/check":
12 InOperation PostMethod:
12 InOperation PostMethod:
13 SecurityRequirementStep 0:
13 SecurityRequirementStep 0:
test/golden/common/servers/trace-tree.yaml+2−2
@@ -1,11 +1,11 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/pets":
2 AtPath "/pets":
3 InOperation GetMethod:
3 InOperation GetMethod:
4 InServer "http://{x}variable.path/{y}/{openVariable1}/{openVariable2}":
4 InServer "http://{x}variable.path/{y}/{openVariable1}/{openVariable2}":
5 - EnumValueNotConsumed 1 "a"
5 - EnumValueNotConsumed 1 "a"
6 - ConsumerNotOpen 7
6 - ConsumerNotOpen 7
7 InServer "http://missing.url": ServerNotMatched
7 InServer "http://missing.url": ServerNotMatched
8−nonBreakingChanges:
8+backwardChanges:
9 AtPath "/pets":
9 AtPath "/pets":
10 InOperation GetMethod:
10 InOperation GetMethod:
11 InServer "http://{x}variable.path/{y}/{openVariable1}/{openVariable2}": EnumValueNotConsumed
11 InServer "http://{x}variable.path/{y}/{openVariable1}/{openVariable2}": EnumValueNotConsumed
test/golden/common/tuple-items/heterogeneous-component-mismatch/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -13,7 +13,7 @@ breakingChanges:
13 OfType Array:
13 OfType Array:
14 InItem 1:
14 InItem 1:
15 OfType Object: TypeBecomesEmpty
15 OfType Object: TypeBecomesEmpty
16−nonBreakingChanges:
16+backwardChanges:
17 AtPath "/test":
17 AtPath "/test":
18 InOperation PostMethod:
18 InOperation PostMethod:
19 InRequest:
19 InRequest:
test/golden/common/tuple-items/heterogeneous-length-mismatch/report.md+3−19
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 2 | 2 | 0 |
5+| 2 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -19,19 +19,3 @@ Tuple length changed from 3 to 2.
19#### `$(Array)`
19#### `$(Array)`
20
20
21Tuple length changed from 3 to 2.
21Tuple length changed from 3 to 2.
22−
23−# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
24−
25−## **POST** /test
26−
27−### 📱➡️ JSON Request
28−
29−#### `$(Array)`
30−
31−Tuple length changed from 3 to 2.
32−
33−### 📱⬅️ JSON Response – 200
34−
35−#### `$(Array)`
36−
37−Tuple length changed from 3 to 2.
test/golden/common/tuple-items/heterogeneous-length-mismatch/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -11,7 +11,7 @@ breakingChanges:
11 PayloadSchema:
11 PayloadSchema:
12 OfType Array: TupleItemsLengthChanged (ProdCons {producer = 2, consumer
12 OfType Array: TupleItemsLengthChanged (ProdCons {producer = 2, consumer
13 = 3})
13 = 3})
14−nonBreakingChanges:
14+backwardChanges:
15 AtPath "/test":
15 AtPath "/test":
16 InOperation PostMethod:
16 InOperation PostMethod:
17 InRequest:
17 InRequest:
test/golden/common/tuple-items/homogeneous-component-mismatch/report.md+1−9
@@ -2,7 +2,7 @@
2
2
3| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
3| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4|------------------------------------------|-------------------------------------------------|-------------------------------|
4|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 4 | 4 | 0 |
5+| 4 | 2 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -34,20 +34,12 @@ The type has been added.
34
34
35### 📱➡️ JSON Request
35### 📱➡️ JSON Request
36
36
37−#### `$(Array)`
38−
39−The array is no longer explicitly defined as a tuple.
40−
41#### `$[0](Number)`
37#### `$[0](Number)`
42
38
43The type has been added.
39The type has been added.
44
40
45### 📱⬅️ JSON Response – 200
41### 📱⬅️ JSON Response – 200
46
42
47−#### `$(Array)`
48−
49−The array is no longer explicitly defined as a tuple.
50−
51#### `$[0](String)`
43#### `$[0](String)`
52
44
53The type has been removed.
45The type has been removed.
test/golden/common/tuple-items/homogeneous-component-mismatch/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -15,7 +15,7 @@ breakingChanges:
15 - ArrayToTuple
15 - ArrayToTuple
16 - InItem 0:
16 - InItem 0:
17 OfType Number: TypeBecomesEmpty
17 OfType Number: TypeBecomesEmpty
18−nonBreakingChanges:
18+backwardChanges:
19 AtPath "/test":
19 AtPath "/test":
20 InOperation PostMethod:
20 InOperation PostMethod:
21 InRequest:
21 InRequest:
test/golden/common/tuple-items/homogeneous-length-mismatch/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test3":
2 AtPath "/test3":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -24,7 +24,7 @@ breakingChanges:
24 ResponsePayload:
24 ResponsePayload:
25 PayloadSchema:
25 PayloadSchema:
26 OfType Array: NoMatchingTupleItems
26 OfType Array: NoMatchingTupleItems
27−nonBreakingChanges:
27+backwardChanges:
28 AtPath "/test3":
28 AtPath "/test3":
29 InOperation PostMethod:
29 InOperation PostMethod:
30 InRequest:
30 InRequest:
test/golden/common/tuple-items/homogeneous-vector/trace-tree.yaml+2−2
@@ -1,2 +1,2 @@
1−breakingChanges: {}
1+forwardChanges: {}
2−nonBreakingChanges: {}
2+backwardChanges: {}
test/golden/common/type-changing/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test5":
2 AtPath "/test5":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -28,7 +28,7 @@ breakingChanges:
28 InRequest:
28 InRequest:
29 InPayload:
29 InPayload:
30 PayloadSchema: TypesRestricted [Number,Array,Object]
30 PayloadSchema: TypesRestricted [Number,Array,Object]
31−nonBreakingChanges:
31+backwardChanges:
32 AtPath "/test5":
32 AtPath "/test5":
33 InOperation PostMethod:
33 InOperation PostMethod:
34 WithStatusCode 200:
34 WithStatusCode 200:
test/golden/common/unguarded-recursive/trace-tree.yaml+2−2
@@ -1,10 +1,10 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/api/foo":
2 AtPath "/api/foo":
3 InOperation GetMethod:
3 InOperation GetMethod:
4 WithStatusCode 200:
4 WithStatusCode 200:
5 ResponsePayload:
5 ResponsePayload:
6 PayloadSchema: UnguardedRecursion
6 PayloadSchema: UnguardedRecursion
7−nonBreakingChanges:
7+backwardChanges:
8 AtPath "/api/foo":
8 AtPath "/api/foo":
9 InOperation GetMethod:
9 InOperation GetMethod:
10 WithStatusCode 200:
10 WithStatusCode 200:
test/golden/common/variant-added/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200:
4 WithStatusCode 200:
@@ -6,7 +6,7 @@ breakingChanges:
6 PayloadSchema:
6 PayloadSchema:
7 OfType Object: PartitionBecomesEmpty (PInProperty "tag" PHere,CByEnumValue
7 OfType Object: PartitionBecomesEmpty (PInProperty "tag" PHere,CByEnumValue
8 (fromList [String "C"]))
8 (fromList [String "C"]))
9−nonBreakingChanges:
9+backwardChanges:
10 AtPath "/test":
10 AtPath "/test":
11 InOperation PostMethod:
11 InOperation PostMethod:
12 InRequest:
12 InRequest:
test/golden/common/variant-changed/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -15,7 +15,7 @@ breakingChanges:
15 InPartition (PInProperty "tag" PHere,CByEnumValue (fromList [String "B"])):
15 InPartition (PInProperty "tag" PHere,CByEnumValue (fromList [String "B"])):
16 InProperty "prop_B":
16 InProperty "prop_B":
17 OfType String: TypeBecomesEmpty
17 OfType String: TypeBecomesEmpty
18−nonBreakingChanges:
18+backwardChanges:
19 AtPath "/test":
19 AtPath "/test":
20 InOperation PostMethod:
20 InOperation PostMethod:
21 InRequest:
21 InRequest:
test/golden/common/variant-deep-changed/trace-tree.yaml+2−2
@@ -1,4 +1,4 @@
1−breakingChanges:
1+forwardChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -15,7 +15,7 @@ breakingChanges:
15 InPartition (PInProperty "desc" (PInProperty "name" PHere),CByEnumValue (fromList [String "B"])):
15 InPartition (PInProperty "desc" (PInProperty "name" PHere),CByEnumValue (fromList [String "B"])):
16 InProperty "prop_B":
16 InProperty "prop_B":
17 OfType String: TypeBecomesEmpty
17 OfType String: TypeBecomesEmpty
18−nonBreakingChanges:
18+backwardChanges:
19 AtPath "/test":
19 AtPath "/test":
20 InOperation PostMethod:
20 InOperation PostMethod:
21 InRequest:
21 InRequest: