git.iko.soy/typeable/compaREST
on master help sign in
Added non-breaking changes to reports (#82)
2440f23iko
app/Main.hs+19−20
@@ -5,19 +5,14 @@ import Control.Monad.Except
5import Data.Aeson
5import Data.Aeson
6import qualified Data.ByteString.Lazy as BSL
6import qualified Data.ByteString.Lazy as BSL
7import Data.Default
7import Data.Default
8−import Data.HList
9import qualified Data.Text.IO as T
8import qualified Data.Text.IO as T
10import qualified Data.Yaml as Yaml
9import qualified Data.Yaml as Yaml
11import FormatHeuristic
10import FormatHeuristic
12−import OpenAPI.Checker.Behavior
13import OpenAPI.Checker.Options
11import OpenAPI.Checker.Options
14−import OpenAPI.Checker.Paths
12+import OpenAPI.Checker.Run
15−import OpenAPI.Checker.PathsPrefixTree
16−import OpenAPI.Checker.Report
17−import OpenAPI.Checker.Subtree
18import System.Exit
13import System.Exit
19import System.IO
14import System.IO
20−import Text.Pandoc
15+import Text.Pandoc hiding (report)
21
16
22main :: IO ()
17main :: IO ()
23main = do
18main = do
@@ -33,23 +28,27 @@ main = do
33 fail "Exiting"
28 fail "Exiting"
34 Right s -> pure s
29 Right s -> pure s
35 Right s -> pure s
30 Right s -> pure s
36− a <- traced (step ClientSchema) <$> parseSchema (clientFile opts)
31+ a <- parseSchema (clientFile opts)
37− b <- traced (step ServerSchema) <$> parseSchema (serverFile opts)
32+ b <- parseSchema (serverFile opts)
38− let result = runCompatFormula $ checkCompatibility HNil Root (ProdCons a b)
39− runPandocIO :: PandocIO a -> ExceptT Errors IO a
33+ let runPandocIO :: PandocIO a -> ExceptT Errors IO a
40 runPandocIO x = lift (runIO x) >>= either (throwError . DocumentError) pure
34 runPandocIO x = lift (runIO x) >>= either (throwError . DocumentError) pure
41 options = def {writerExtensions = githubMarkdownExtensions}
35 options = def {writerExtensions = githubMarkdownExtensions}
42− output :: Either (PathsPrefixTree Behave AnIssue 'APILevel) () -> ExceptT Errors IO ()
36+ write :: Pandoc -> ExceptT Errors IO ()
43− output = case outputMode opts of
37+ write = case outputMode opts of
44− StdoutMode -> lift . T.putStrLn <=< runPandocIO . writeMarkdown options . generateReport
38+ StdoutMode -> lift . T.putStrLn <=< runPandocIO . writeMarkdown options
45 FileMode f -> case formatFromFilePath f of
39 FileMode f -> case formatFromFilePath f of
46 Nothing -> \_ -> throwError UnknownOutputFormat
40 Nothing -> \_ -> throwError UnknownOutputFormat
47− Just (TextWriter writer) -> lift . T.writeFile f <=< runPandocIO . writer options . generateReport
41+ Just (TextWriter writer) -> lift . T.writeFile f <=< runPandocIO . writer options
48− Just (ByteStringWriter writer) -> lift . BSL.writeFile f <=< runPandocIO . writer options . generateReport
42+ Just (ByteStringWriter writer) -> lift . BSL.writeFile f <=< runPandocIO . writer options
43+ -- output :: Either (PathsPrefixTree Behave AnIssue 'APILevel) () -> ExceptT Errors IO ()
44+ -- output inp = do
45+ -- undefined
46+ (report, status) = runReport (a, b)
49− either handler pure <=< runExceptT $ output result
47+ either handler pure <=< runExceptT $ write report
50− case result of
48+ case status of
51− Right () -> exitSuccess
49+ NoBreakingChanges -> exitSuccess
52− Left _ -> exitWith $ ExitFailure 1
50+ BreakingChanges -> exitWith $ ExitFailure 1
51+ OnlyUnsupportedChanges -> exitWith $ ExitFailure 2
53
52
54data Errors
53data Errors
55 = DocumentError PandocError
54 = DocumentError PandocError
openapi-diff.cabal+3−1
@@ -35,7 +35,7 @@ common common-options
35 -Wno-missing-local-signatures
35 -Wno-missing-local-signatures
36 -Wno-unsafe
36 -Wno-unsafe
37 default-language: Haskell2010
37 default-language: Haskell2010
38− build-depends: base >= 4.12.0.0 && < 4.15
38+ build-depends: base >= 4.12.0.0 && < 4.16
39 , bytestring
39 , bytestring
40 , text
40 , text
41
41
@@ -104,6 +104,7 @@ library
104 , transformers
104 , transformers
105 , mtl
105 , mtl
106 , aeson
106 , aeson
107+ , generic-data
107 hs-source-dirs: src
108 hs-source-dirs: src
108 exposed-modules: Data.HList
109 exposed-modules: Data.HList
109 , OpenAPI.Checker.Behavior
110 , OpenAPI.Checker.Behavior
@@ -134,6 +135,7 @@ library
134 , OpenAPI.Checker.Report
135 , OpenAPI.Checker.Report
135 , Data.OpenUnion.Extra
136 , Data.OpenUnion.Extra
136 , OpenAPI.Checker.Report.Jet
137 , OpenAPI.Checker.Report.Jet
138+ , OpenAPI.Checker.Run
137
139
138executable openapi-diff
140executable openapi-diff
139 import: common-options
141 import: common-options
src/OpenAPI/Checker/Behavior.hs+19−1
@@ -2,6 +2,8 @@ module OpenAPI.Checker.Behavior
2 ( BehaviorLevel (..)
2 ( BehaviorLevel (..)
3 , Behavable (..)
3 , Behavable (..)
4 , Issuable (..)
4 , Issuable (..)
5+ , Orientation (..)
6+ , toggleOrientation
5 , Behavior
7 , Behavior
6 , AnIssue (..)
8 , AnIssue (..)
7 )
9 )
@@ -43,9 +45,25 @@ type instance AdditionalQuiverConstraints Behave a b = Behavable a b
43
45
44class (Typeable l, Ord (Issue l), Show (Issue l)) => Issuable (l :: BehaviorLevel) where
46class (Typeable l, Ord (Issue l), Show (Issue l)) => Issuable (l :: BehaviorLevel) where
45 data Issue l :: Type
47 data Issue l :: Type
48+
49+ -- | The same issues can be rendered in multiple places and might
50+ -- require different ways of represnting them to the user.
51+ --
52+ -- In practice each issue requires a maximum of two different representations:
53+ -- based on the context the issue might need to be rendered as "opposite" ('Backward')
54+ -- – for example when rendering non-breaking changes everything should be
55+ -- reversed (a consequence of the way we generate non-breaking changes).
46− describeIssue :: Issue l -> Blocks
56+ describeIssue :: Orientation -> Issue l -> Blocks
57+
47 issueIsUnsupported :: Issue l -> Bool
58 issueIsUnsupported :: Issue l -> Bool
48
59
60+data Orientation = Forward | Backward
61+ deriving stock (Eq, Ord)
62+
63+toggleOrientation :: Orientation -> Orientation
64+toggleOrientation Forward = Backward
65+toggleOrientation Backward = Forward
66+
49-- | A set of interactions having common unifying features
67-- | A set of interactions having common unifying features
50type Behavior = Paths Behave 'APILevel
68type Behavior = Paths Behave 'APILevel
51
69
src/OpenAPI/Checker/Report.hs+102−43
@@ -1,15 +1,20 @@
1module OpenAPI.Checker.Report
1module OpenAPI.Checker.Report
2 ( generateReport
2 ( generateReport
3+ , ReportInput (..)
4+ , ReportStatus (..)
5+ , Pandoc
3 )
6 )
4where
7where
5
8
6import Control.Monad.Free hiding (unfoldM)
9import Control.Monad.Free hiding (unfoldM)
7import Control.Monad.Reader
10import Control.Monad.Reader
8import Control.Monad.Writer
11import Control.Monad.Writer
12+import Data.Aeson (ToJSON)
9import Data.Either
13import Data.Either
10import Data.Foldable
14import Data.Foldable
11import Data.Function
15import Data.Function
12import Data.Functor
16import Data.Functor
17+import Data.Functor.Const
13import Data.List.NonEmpty
18import Data.List.NonEmpty
14import qualified Data.List.NonEmpty as NE
19import qualified Data.List.NonEmpty as NE
15import qualified Data.Map as M
20import qualified Data.Map as M
@@ -22,6 +27,7 @@ import Data.Text (Text)
22import qualified Data.Text as T
27import qualified Data.Text as T
23import Data.TypeRepMap hiding (empty)
28import Data.TypeRepMap hiding (empty)
24import Data.Typeable
29import Data.Typeable
30+import Generic.Data
25import OpenAPI.Checker.Behavior
31import OpenAPI.Checker.Behavior
26import OpenAPI.Checker.Paths
32import OpenAPI.Checker.Paths
27import OpenAPI.Checker.PathsPrefixTree hiding (empty)
33import OpenAPI.Checker.PathsPrefixTree hiding (empty)
@@ -31,27 +37,79 @@ import OpenAPI.Checker.Validate.OpenApi
31import OpenAPI.Checker.Validate.Schema
37import OpenAPI.Checker.Validate.Schema
32import Text.Pandoc.Builder
38import Text.Pandoc.Builder
33
39
34−generateReport :: Either (P.PathsPrefixTree Behave AnIssue 'APILevel) () -> Pandoc
40+type Changes = P.PathsPrefixTree Behave AnIssue 'APILevel
35−generateReport (Right ()) = doc $ header 1 "No breaking changes found ✨"
41+
42+type ProcessedChanges a = P.PathsPrefixTree Behave (FunctorTuple (Const Orientation) AnIssue) a
43+
44+data FunctorTuple f g a = FunctorTuple (f a) (g a)
45+ deriving stock (Eq, Ord)
46+
47+data ReportInput = ReportInput
48+ { breakingChanges :: Changes
49+ , nonBreakingChanges :: Changes
50+ }
51+ deriving stock (Generic)
52+ deriving (Semigroup, Monoid) via (Generically ReportInput)
53+ deriving anyclass (ToJSON)
54+
55+data ReportStatus
56+ = BreakingChanges
57+ | NoBreakingChanges
58+ | -- | All changes that could be breaking are unsupported – we don't know if
59+ -- there actually are any breaking changes.
60+ OnlyUnsupportedChanges
61+
62+preprocessChanges :: Orientation -> Changes -> ProcessedChanges 'APILevel
63+preprocessChanges initialO = P.fromList . fmap process . P.toList
64+ where
65+ process :: AnItem Behave AnIssue 'APILevel -> AnItem Behave (FunctorTuple (Const Orientation) AnIssue) 'APILevel
66+ process (AnItem paths issue) = AnItem paths $ FunctorTuple (Const $ toggle initialO) issue
67+ where
68+ (Endo toggle) = togglePaths paths
69+
70+ togglePaths :: Paths Behave a c -> Endo Orientation
71+ togglePaths Root = mempty
72+ togglePaths (rest `Snoc` (_ :: Behave b c)) = case eqT @c @'ResponseLevel of
73+ Just Refl -> Endo toggleOrientation <> togglePaths rest
74+ Nothing -> togglePaths rest
75+
76+generateReport :: ReportInput -> (Pandoc, ReportStatus)
36−generateReport (Left errs) = doc $
77+generateReport inp =
37− runReportMonad jets $ do
38− let (unsupported, breaking) = P.partition (\(AnIssue i) -> issueIsUnsupported i) errs
78+ let partitionUnsupported = P.partition (\(AnIssue i) -> issueIsUnsupported i)
79+ (bUnsupported, preprocessChanges Forward -> breaking) =
80+ partitionUnsupported $ breakingChanges inp
81+ (nbUnsupported, preprocessChanges Backward -> nonBreaking) =
82+ partitionUnsupported $ nonBreakingChanges inp
83+ unsupported = preprocessChanges Forward $ bUnsupported <> nbUnsupported
39− breakingChangesPresent = not $ P.null breaking
84+ breakingChangesPresent = not $ P.null breaking
85+ nonBreakingChangesPresent = not $ P.null nonBreaking
40− unsupportedChangesPresent = not $ P.null unsupported
86+ unsupportedChangesPresent = not $ P.null unsupported
87+ report = doc $
88+ runReportMonad jets $ do
41− smartHeader "Summary"
89+ smartHeader "Summary"
42− tell $
90+ tell $
43− simpleTable
91+ simpleTable
44− (para
92+ (para
45− <$> [ refOpt breakingChangesPresent breakingChangesId "⚠️ Breaking changes"
93+ <$> [ refOpt breakingChangesPresent breakingChangesId "⚠️ Breaking changes"
94+ , refOpt nonBreakingChangesPresent nonBreakingChangesId "🙆 Non-breaking changes"
46− , refOpt unsupportedChangesPresent unsupportedChangesId "🤷 Unsupported feature changes"
95+ , refOpt unsupportedChangesPresent unsupportedChangesId "🤷 Unsupported feature changes"
47− ])
96+ ])
48− [para . show' <$> [P.size breaking, P.size unsupported]]
97+ [para . show' <$> [P.size breaking, P.size nonBreaking, P.size unsupported]]
49− when breakingChangesPresent $ do
98+ when breakingChangesPresent $ do
50− smartHeader $ anchor breakingChangesId <> "⚠️ Breaking changes"
99+ smartHeader $ anchor breakingChangesId <> "⚠️ Breaking changes"
51− incrementHeaders $ showErrs breaking
100+ incrementHeaders $ showErrs breaking
101+ when nonBreakingChangesPresent $ do
102+ smartHeader $ anchor nonBreakingChangesId <> "🙆 Non-breaking changes"
103+ incrementHeaders $ showErrs nonBreaking
52− when unsupportedChangesPresent $ do
104+ when unsupportedChangesPresent $ do
53− smartHeader $ anchor unsupportedChangesId <> "🤷 Unsupported feature changes"
105+ smartHeader $ anchor unsupportedChangesId <> "🤷 Unsupported feature changes"
54− incrementHeaders $ showErrs unsupported
106+ incrementHeaders $ showErrs unsupported
107+ status =
108+ if
109+ | breakingChangesPresent -> BreakingChanges
110+ | unsupportedChangesPresent -> OnlyUnsupportedChanges
111+ | otherwise -> NoBreakingChanges
112+ in (report, status)
55 where
113 where
56 anchor :: Text -> Inlines
114 anchor :: Text -> Inlines
57 anchor a = spanWith (a, [], []) mempty
115 anchor a = spanWith (a, [], []) mempty
@@ -60,11 +118,10 @@ generateReport (Left errs) = doc $
60 refOpt False _ i = i
118 refOpt False _ i = i
61 refOpt True a i = link ("#" <> a) "" i
119 refOpt True a i = link ("#" <> a) "" i
62
120
63− breakingChangesId :: Text
121+ breakingChangesId, nonBreakingChangesId, unsupportedChangesId :: Text
64 breakingChangesId = "breaking-changes"
122 breakingChangesId = "breaking-changes"
65−
66− unsupportedChangesId :: Text
67 unsupportedChangesId = "unsupported-changes"
123 unsupportedChangesId = "unsupported-changes"
124+ nonBreakingChangesId = "non-breaking-changes"
68
125
69data ReportState = ReportState
126data ReportState = ReportState
70 { sourceJets :: [ReportJet' Behave Inlines]
127 { sourceJets :: [ReportJet' Behave Inlines]
@@ -88,22 +145,24 @@ smartHeader i = do
88 h <- asks headerLevel
145 h <- asks headerLevel
89 tell $ header h i
146 tell $ header h i
90
147
91−showErrs :: forall a. Typeable a => P.PathsPrefixTree Behave AnIssue a -> ReportMonad ()
148+showErrs :: forall a. Typeable a => ProcessedChanges a -> ReportMonad ()
92showErrs x@(P.PathsPrefixNode currentIssues _) = do
149showErrs x@(P.PathsPrefixNode currentIssues _) = do
93 let -- Extract this pattern if more cases like this arise
150 let -- Extract this pattern if more cases like this arise
94− (removedPaths :: [Issue 'APILevel], otherIssues :: Set (AnIssue a)) = case eqT @a @'APILevel of
151+ ( removedPaths :: [Issue 'APILevel]
152+ , otherIssues :: Set (FunctorTuple (Const Orientation) AnIssue a)
153+ ) = case eqT @a @'APILevel of
95− Just Refl ->
154+ Just Refl ->
96− let (p, o) =
155+ let (p, o) =
97− S.partition
156+ S.partition
98− (\(AnIssue u) -> case u of
157+ (\(FunctorTuple _ (AnIssue u)) -> case u of
99− NoPathsMatched {} -> True
158+ NoPathsMatched {} -> True
100− AllPathsFailed {} -> True)
159+ AllPathsFailed {} -> True)
101− currentIssues
160+ currentIssues
102− p' = S.toList p <&> (\(AnIssue i) -> i)
161+ p' = S.toList p <&> (\(FunctorTuple _ (AnIssue i)) -> i)
103− in (p', o)
162+ in (p', o)
104− Nothing -> (mempty, currentIssues)
163+ Nothing -> (mempty, currentIssues)
105 jts <- asks sourceJets
164 jts <- asks sourceJets
106− for_ otherIssues $ \(AnIssue i) -> tell . describeIssue $ i
165+ for_ otherIssues $ \(FunctorTuple (Const ori) (AnIssue i)) -> tell . describeIssue ori $ i
107 unless ([] == removedPaths) $ do
166 unless ([] == removedPaths) $ do
108 smartHeader "Removed paths"
167 smartHeader "Removed paths"
109 tell $
168 tell $
@@ -135,9 +194,9 @@ jets =
135 <$> [ constructReportJet jsonPathJet
194 <$> [ constructReportJet jsonPathJet
136 , constructReportJet $ \p@(AtPath _) op@(InOperation _) ->
195 , constructReportJet $ \p@(AtPath _) op@(InOperation _) ->
137 strong (describeBehaviour op) <> " " <> describeBehaviour p :: Inlines
196 strong (describeBehaviour op) <> " " <> describeBehaviour p :: Inlines
138− , constructReportJet $ \InRequest InPayload PayloadSchema -> "JSON Request" :: Inlines
197+ , constructReportJet $ \InRequest InPayload PayloadSchema -> "📱➡️ JSON Request" :: Inlines
139 , constructReportJet $ \(WithStatusCode c) ResponsePayload PayloadSchema ->
198 , constructReportJet $ \(WithStatusCode c) ResponsePayload PayloadSchema ->
140− "JSON Response – " <> str (T.pack . show $ c) :: Inlines
199+ "📱⬅️ JSON Response – " <> str (T.pack . show $ c) :: Inlines
141 ]
200 ]
142 where
201 where
143 unwrapReportJetResult :: ReportJetResult Behave x -> ReportJet' Behave x
202 unwrapReportJetResult :: ReportJetResult Behave x -> ReportJet' Behave x
@@ -177,8 +236,8 @@ jets =
177
236
178observeJetShowErrs
237observeJetShowErrs
179 :: ReportJet' Behave Inlines
238 :: ReportJet' Behave Inlines
180− -> P.PathsPrefixTree Behave AnIssue a
239+ -> ProcessedChanges a
181− -> ReportMonad (P.PathsPrefixTree Behave AnIssue a)
240+ -> ReportMonad (ProcessedChanges a)
182observeJetShowErrs jet p = case observeJetShowErrs' jet p of
241observeJetShowErrs jet p = case observeJetShowErrs' jet p of
183 Just m -> m
242 Just m -> m
184 Nothing -> pure p
243 Nothing -> pure p
@@ -186,8 +245,8 @@ observeJetShowErrs jet p = case observeJetShowErrs' jet p of
186observeJetShowErrs'
245observeJetShowErrs'
187 :: forall a.
246 :: forall a.
188 ReportJet' Behave Inlines
247 ReportJet' Behave Inlines
189− -> P.PathsPrefixTree Behave AnIssue a
248+ -> ProcessedChanges a
190− -> Maybe (ReportMonad (P.PathsPrefixTree Behave AnIssue a))
249+ -> Maybe (ReportMonad (ProcessedChanges a))
191observeJetShowErrs' (ReportJet jet) (P.PathsPrefixNode currentIssues subIssues) =
250observeJetShowErrs' (ReportJet jet) (P.PathsPrefixNode currentIssues subIssues) =
192 let results =
251 let results =
193 subIssues >>= \(WrapTypeable (AStep m)) ->
252 subIssues >>= \(WrapTypeable (AStep m)) ->
src/OpenAPI/Checker/Run.hsnew file+30
@@ -0,0 +1,30 @@
1+module OpenAPI.Checker.Run
2+ ( runChecker
3+ , runReport
4+ , module OpenAPI.Checker.Report
5+ )
6+where
7+
8+import Data.HList
9+import Data.OpenApi (OpenApi)
10+import OpenAPI.Checker.Paths
11+import OpenAPI.Checker.Report
12+import OpenAPI.Checker.Subtree
13+import OpenAPI.Checker.Validate.OpenApi ()
14+
15+runChecker :: (OpenApi, OpenApi) -> ReportInput
16+runChecker (client, server) =
17+ ReportInput
18+ { breakingChanges = run client server
19+ , nonBreakingChanges = run server client
20+ }
21+ where
22+ toPC p c =
23+ ProdCons
24+ { producer = traced (step ClientSchema) p
25+ , consumer = traced (step ServerSchema) c
26+ }
27+ run p c = either id mempty . runCompatFormula . checkCompatibility HNil Root $ toPC p c
28+
29+runReport :: (OpenApi, OpenApi) -> (Pandoc, ReportStatus)
30+runReport = generateReport . runChecker
src/OpenAPI/Checker/Subtree/Deriving.hsdeleted−6
@@ -1,6 +0,0 @@
1−module OpenAPI.Checker.Subtree.Deriving (EqSubtree (..)) where
2−
3−import Control.Monad
4−import OpenAPI.Checker.Subtree
5−
6−newtype EqSubtree t = EqSubtree t
src/OpenAPI/Checker/Validate/Header.hs+5−3
@@ -51,9 +51,11 @@ instance Issuable 'HeaderLevel where
51 | HeaderSchemaRequired
51 | HeaderSchemaRequired
52 deriving stock (Eq, Ord, Show)
52 deriving stock (Eq, Ord, Show)
53 issueIsUnsupported _ = False
53 issueIsUnsupported _ = False
54− describeIssue RequiredHeaderMissing = para "Header has become required."
54+ describeIssue Forward RequiredHeaderMissing = para "Header has become required."
55+ describeIssue Backward RequiredHeaderMissing = para "Header is no longer required."
55− describeIssue NonEmptyHeaderRequired = para "The header does not allow empty values anymore."
56+ describeIssue Forward NonEmptyHeaderRequired = para "The header does not allow empty values anymore."
57+ describeIssue Backward NonEmptyHeaderRequired = para "The header now allows empty values."
56− describeIssue HeaderSchemaRequired = para "Expected header schema, but it is not present."
58+ describeIssue _ HeaderSchemaRequired = para "Expected header schema, but it is not present."
57
59
58instance Behavable 'HeaderLevel 'SchemaLevel where
60instance Behavable 'HeaderLevel 'SchemaLevel where
59 data Behave 'HeaderLevel 'SchemaLevel
61 data Behave 'HeaderLevel 'SchemaLevel
src/OpenAPI/Checker/Validate/Link.hs+1−1
@@ -19,4 +19,4 @@ instance Issuable 'LinkLevel where
19 deriving stock (Eq, Ord, Show)
19 deriving stock (Eq, Ord, Show)
20 issueIsUnsupported = \case
20 issueIsUnsupported = \case
21 LinksUnsupported -> True
21 LinksUnsupported -> True
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+13−7
@@ -42,9 +42,10 @@ instance Issuable 'PayloadLevel where
42 EncodingNotSupported -> True
42 EncodingNotSupported -> True
43 _ -> False
43 _ -> False
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 (MediaEncodingMissing enc) = para $ "Media encoding " <> str enc <> " added."
47+ describeIssue Backward (MediaEncodingMissing enc) = para $ "Media encoding " <> str enc <> " added."
47− describeIssue EncodingNotSupported = para "OpenApi Diff does not currently support media encodings other than JSON."
48+ describeIssue _ EncodingNotSupported = para "OpenApi Diff does not currently support media encodings other than JSON."
48
49
49instance Behavable 'PayloadLevel 'SchemaLevel where
50instance Behavable 'PayloadLevel 'SchemaLevel where
50 data Behave 'PayloadLevel 'SchemaLevel
51 data Behave 'PayloadLevel 'SchemaLevel
@@ -153,11 +154,16 @@ instance Issuable 'OperationLevel where
153 deriving stock (Eq, Ord, Show)
154 deriving stock (Eq, Ord, Show)
154 issueIsUnsupported = \case
155 issueIsUnsupported = \case
155 _ -> False
156 _ -> False
156− describeIssue (ResponseCodeNotFound c) =
157+ describeIssue Forward (ResponseCodeNotFound c) =
157 para $ "Reponse code " <> (str . T.pack . show $ c) <> " has been added."
158 para $ "Reponse code " <> (str . T.pack . show $ c) <> " has been added."
159+ describeIssue Backward (ResponseCodeNotFound c) =
160+ para $ "Reponse code " <> (str . T.pack . show $ c) <> " has been removed."
158− describeIssue (ParamNotMatched param) =
161+ describeIssue Forward (ParamNotMatched param) =
159 para $ "Parameter " <> code param <> " has become required."
162 para $ "Parameter " <> code param <> " has become required."
163+ describeIssue Backward (ParamNotMatched param) =
164+ para $ "Parameter " <> code param <> " is no longer required."
160− describeIssue (PathFragmentNotMatched i) =
165+ describeIssue _ (PathFragmentNotMatched i) =
161 -- TODO: Indices are meaningless in this context. Replace with a better error.
166 -- TODO: Indices are meaningless in this context. Replace with a better error.
162 para $ "Path fragment " <> (str . T.pack . show $ i) <> " not matched."
167 para $ "Path fragment " <> (str . T.pack . show $ i) <> " not matched."
163− describeIssue NoRequestBody = para "Request body has been added."
168+ describeIssue Forward NoRequestBody = para "Request body has been added."
169+ describeIssue Backward NoRequestBody = para "Request body has been removed."
src/OpenAPI/Checker/Validate/OAuth2Flows.hs+28−20
@@ -104,8 +104,9 @@ instance Issuable 'SecurityRequirementLevel where
104 | UndefinedSecurityScheme Text
104 | UndefinedSecurityScheme Text
105 deriving stock (Eq, Ord, Show)
105 deriving stock (Eq, Ord, Show)
106 issueIsUnsupported _ = False
106 issueIsUnsupported _ = False
107− describeIssue SecurityRequirementNotMet = para "Security scheme has been removed."
107+ describeIssue Forward SecurityRequirementNotMet = para "Security scheme has been removed."
108+ describeIssue Backward SecurityRequirementNotMet = para "Security scheme was added."
108− describeIssue (UndefinedSecurityScheme k) = para $ "Security scheme " <> code k <> " is not defined."
109+ describeIssue _ (UndefinedSecurityScheme k) = para $ "Security scheme " <> code k <> " is not defined."
109
110
110instance Issuable 'SecuritySchemeLevel where
111instance Issuable 'SecuritySchemeLevel where
111 data Issue 'SecuritySchemeLevel
112 data Issue 'SecuritySchemeLevel
@@ -129,26 +130,33 @@ instance Issuable 'SecuritySchemeLevel where
129 | ScopeNotDefined Text
130 | ScopeNotDefined Text
130 deriving stock (Eq, Ord, Show)
131 deriving stock (Eq, Ord, Show)
131 issueIsUnsupported _ = False
132 issueIsUnsupported _ = False
132− describeIssue RefreshUrlsDontMatch = para "Refresh URL changed."
133+ describeIssue _ RefreshUrlsDontMatch = para "Refresh URL changed."
133− describeIssue (HttpSchemeTypesDontMatch _ _) = para "HTTP scheme type changed."
134+ describeIssue _ (HttpSchemeTypesDontMatch _ _) = para "HTTP scheme type changed."
134− describeIssue (ApiKeyParamsDontMatch _ _) = para "API Key parameters changed."
135+ describeIssue _ (ApiKeyParamsDontMatch _ _) = para "API Key parameters changed."
135− describeIssue (OpenIdConnectUrlsDontMatch _ _) = para "OpenaId Connect URL changed."
136+ describeIssue _ (OpenIdConnectUrlsDontMatch _ _) = para "OpenaId Connect URL changed."
136− describeIssue (CustomHttpSchemesDontMatch e a) =
137+ describeIssue _ (CustomHttpSchemesDontMatch e a) =
137 para $ "Changed HTTP scheme from " <> code e <> " to " <> code a <> "."
138 para $ "Changed HTTP scheme from " <> code e <> " to " <> code a <> "."
138− describeIssue ConsumerDoesNotSupportImplicitFlow = para "Implicit flow support has been removed."
139+ describeIssue Forward ConsumerDoesNotSupportImplicitFlow = para "Implicit flow support has been removed."
140+ describeIssue Backward ConsumerDoesNotSupportImplicitFlow = para "Implicit flow support has been added."
139− describeIssue ConsumerDoesNotSupportPasswordFlow = para "Password flow support has been removed."
141+ describeIssue Forward ConsumerDoesNotSupportPasswordFlow = para "Password flow support has been removed."
142+ describeIssue Backward ConsumerDoesNotSupportPasswordFlow = para "Password flow support has been added."
140− describeIssue ConsumerDoesNotSupportClientCridentialsFlow = para "Client Cridentials flow support has been removed."
143+ describeIssue Forward ConsumerDoesNotSupportClientCridentialsFlow = para "Client Cridentials flow support has been removed."
144+ describeIssue Backward ConsumerDoesNotSupportClientCridentialsFlow = para "Client Cridentials flow support has been added."
141− describeIssue ConsumerDoesNotSupportAuthorizationCodeFlow = para "Authorization Code flow support has been removed."
145+ describeIssue Forward ConsumerDoesNotSupportAuthorizationCodeFlow = para "Authorization Code flow support has been removed."
146+ describeIssue Backward ConsumerDoesNotSupportAuthorizationCodeFlow = para "Authorization Code flow support has been added."
142− describeIssue SecuritySchemeNotMatched = para "Security scheme has been removed."
147+ describeIssue Forward SecuritySchemeNotMatched = para "Security scheme has been removed."
148+ describeIssue Backward SecuritySchemeNotMatched = para "Security scheme has been added."
143− describeIssue OAuth2ImplicitFlowNotEqual = para "Implicit Flow changed."
149+ describeIssue _ OAuth2ImplicitFlowNotEqual = para "Implicit Flow changed."
144− describeIssue OAuth2PasswordFlowNotEqual = para "Password Flow changed."
150+ describeIssue _ OAuth2PasswordFlowNotEqual = para "Password Flow changed."
145− describeIssue OAuth2ClientCredentialsFlowNotEqual = para "Client Cridentials Flow changed."
151+ describeIssue _ OAuth2ClientCredentialsFlowNotEqual = para "Client Cridentials Flow changed."
146− describeIssue OAuth2AuthorizationCodeFlowNotEqual = para "Authorization Code Flow changed."
152+ describeIssue _ OAuth2AuthorizationCodeFlowNotEqual = para "Authorization Code Flow changed."
147− describeIssue (ScopesMissing ss) =
153+ describeIssue Forward (ScopesMissing ss) =
148 para "New scopes required:" <> bulletList (S.toList ss <&> codeBlock)
154 para "New scopes required:" <> bulletList (S.toList ss <&> codeBlock)
155+ describeIssue Backward (ScopesMissing ss) =
156+ para "Scopes no longer required:" <> bulletList (S.toList ss <&> codeBlock)
149− describeIssue DifferentSecuritySchemes = para "Completely different security scheme types."
157+ describeIssue _ DifferentSecuritySchemes = para "Completely different security scheme types."
150− describeIssue CanNotHaveScopes = para "The specified security scheme can not have scopes."
158+ describeIssue _ CanNotHaveScopes = para "The specified security scheme can not have scopes."
151− describeIssue (ScopeNotDefined k) = para $ "Scope with key " <> code k <> " is not defined."
159+ describeIssue _ (ScopeNotDefined k) = para $ "Scope with key " <> code k <> " is not defined."
152
160
153instance Behavable 'SecurityRequirementLevel 'SecuritySchemeLevel where
161instance Behavable 'SecurityRequirementLevel 'SecuritySchemeLevel where
154 data Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
162 data Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
src/OpenAPI/Checker/Validate/Operation.hs+7−4
@@ -359,8 +359,10 @@ instance Issuable 'APILevel where
359 -- When several paths match given but all checks failed
359 -- When several paths match given but all checks failed
360 deriving stock (Eq, Ord, Show)
360 deriving stock (Eq, Ord, Show)
361 issueIsUnsupported _ = False
361 issueIsUnsupported _ = False
362− describeIssue (NoPathsMatched p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
362+ describeIssue Forward (NoPathsMatched p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
363+ describeIssue Backward (NoPathsMatched p) = para $ "The path " <> (code . T.pack) p <> " has been added."
363− describeIssue (AllPathsFailed p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
364+ describeIssue Forward (AllPathsFailed p) = para $ "The path " <> (code . T.pack) p <> " has been removed."
365+ describeIssue Backward (AllPathsFailed p) = para $ "The path " <> (code . T.pack) p <> " has been added."
364
366
365instance Behavable 'APILevel 'PathLevel where
367instance Behavable 'APILevel 'PathLevel where
366 data Behave 'APILevel 'PathLevel
368 data Behave 'APILevel 'PathLevel
@@ -462,7 +464,8 @@ instance Issuable 'PathLevel where
462 = OperationMissing OperationMethod
464 = OperationMissing OperationMethod
463 deriving stock (Eq, Ord, Show)
465 deriving stock (Eq, Ord, Show)
464 issueIsUnsupported _ = False
466 issueIsUnsupported _ = False
465− describeIssue (OperationMissing op) = para $ "Method " <> strong (showMethod op) <> " has been removed."
467+ describeIssue Forward (OperationMissing op) = para $ "Method " <> strong (showMethod op) <> " has been removed."
468+ describeIssue Backward (OperationMissing op) = para $ "Method " <> strong (showMethod op) <> " has been added."
466
469
467instance Behavable 'PathLevel 'OperationLevel where
470instance Behavable 'PathLevel 'OperationLevel where
468 data Behave 'PathLevel 'OperationLevel
471 data Behave 'PathLevel 'OperationLevel
@@ -579,7 +582,7 @@ instance Issuable 'CallbackLevel where
579 deriving stock (Eq, Ord, Show)
582 deriving stock (Eq, Ord, Show)
580 issueIsUnsupported = \case
583 issueIsUnsupported = \case
581 CallbacksUnsupported -> True
584 CallbacksUnsupported -> True
582− describeIssue CallbacksUnsupported = para "OpenApi Diff does not currently support callbacks."
585+ describeIssue _ CallbacksUnsupported = para "OpenApi Diff does not currently support callbacks."
583
586
584tracedCallbackPathItems :: Traced Callback -> Traced ProcessedPathItems
587tracedCallbackPathItems :: Traced Callback -> Traced ProcessedPathItems
585tracedCallbackPathItems (Traced t (Callback x)) =
588tracedCallbackPathItems (Traced t (Callback x)) =
src/OpenAPI/Checker/Validate/Param.hs+9−7
@@ -69,13 +69,15 @@ instance Issuable 'PathFragmentLevel where
69 | PathFragmentsDontMatch Text Text
69 | PathFragmentsDontMatch Text Text
70 deriving stock (Eq, Ord, Show)
70 deriving stock (Eq, Ord, Show)
71 issueIsUnsupported _ = False
71 issueIsUnsupported _ = False
72− describeIssue ParamNameMismatch = para "The path fragments don't match."
72+ describeIssue _ ParamNameMismatch = para "The path fragments don't match."
73− describeIssue ParamEmptinessIncompatible = para "Expected that an empty parameter is allowed, but it isn't."
73+ describeIssue Forward ParamEmptinessIncompatible = para "The parameter can no longer be empty."
74+ describeIssue Backward ParamEmptinessIncompatible = para "The parameter can now be empty."
74− describeIssue ParamRequired = para "Parameter has become required."
75+ describeIssue Forward ParamRequired = para "Parameter has become required."
76+ describeIssue Backward ParamRequired = para "Parameter is no longer required."
75− describeIssue ParamPlaceIncompatible = para "Parameters in incompatible locations."
77+ describeIssue _ ParamPlaceIncompatible = para "Parameters in incompatible locations."
76− describeIssue ParamStyleMismatch = para "Different parameter styles (encodings)."
78+ describeIssue _ ParamStyleMismatch = para "Different parameter styles (encodings)."
77− describeIssue ParamSchemaMismatch = para "Expected a schema, but didn't find one."
79+ describeIssue _ ParamSchemaMismatch = para "Expected a schema, but didn't find one."
78− describeIssue (PathFragmentsDontMatch e a) = para $ "Parameter changed from " <> code e <> " to " <> code a <> "."
80+ describeIssue _ (PathFragmentsDontMatch e a) = para $ "Parameter changed from " <> code e <> " to " <> code a <> "."
79
81
80instance Behavable 'PathFragmentLevel 'SchemaLevel where
82instance Behavable 'PathFragmentLevel 'SchemaLevel where
81 data Behave 'PathFragmentLevel 'SchemaLevel
83 data Behave 'PathFragmentLevel 'SchemaLevel
src/OpenAPI/Checker/Validate/RequestBody.hs+6−2
@@ -31,10 +31,14 @@ instance Issuable 'RequestLevel where
31 | RequestMediaTypeNotFound MediaType
31 | RequestMediaTypeNotFound MediaType
32 deriving stock (Eq, Ord, Show)
32 deriving stock (Eq, Ord, Show)
33 issueIsUnsupported _ = False
33 issueIsUnsupported _ = False
34− describeIssue RequestBodyRequired =
34+ describeIssue Forward RequestBodyRequired =
35 para "Request body has become required."
35 para "Request body has become required."
36+ describeIssue Backward RequestBodyRequired =
37+ para "Request body is no longer required."
36− describeIssue (RequestMediaTypeNotFound t) =
38+ describeIssue Forward (RequestMediaTypeNotFound t) =
37 para $ "Media type " <> (code . T.pack . show $ t) <> " has been removed."
39 para $ "Media type " <> (code . T.pack . show $ t) <> " has been removed."
40+ describeIssue Backward (RequestMediaTypeNotFound t) =
41+ para $ "Media type " <> (code . T.pack . show $ t) <> " has been added."
38
42
39instance Behavable 'RequestLevel 'PayloadLevel where
43instance Behavable 'RequestLevel 'PayloadLevel where
40 data Behave 'RequestLevel 'PayloadLevel
44 data Behave 'RequestLevel 'PayloadLevel
src/OpenAPI/Checker/Validate/Responses.hs+6−2
@@ -72,10 +72,14 @@ instance Issuable 'ResponseLevel where
72 | ResponseHeaderMissing HeaderName
72 | ResponseHeaderMissing HeaderName
73 deriving stock (Eq, Ord, Show)
73 deriving stock (Eq, Ord, Show)
74 issueIsUnsupported _ = False
74 issueIsUnsupported _ = False
75+ describeIssue Forward (ResponseMediaTypeMissing t) =
76+ para $ "Media type was removed: " <> (code . T.pack . show $ t) <> "."
75− describeIssue (ResponseMediaTypeMissing t) =
77+ describeIssue Backward (ResponseMediaTypeMissing t) =
76 para $ "New media type was added: " <> (code . T.pack . show $ t) <> "."
78 para $ "New media type was added: " <> (code . T.pack . show $ t) <> "."
77− describeIssue (ResponseHeaderMissing h) =
79+ describeIssue Forward (ResponseHeaderMissing h) =
78 para $ "New header was added " <> code h <> "."
80 para $ "New header was added " <> code h <> "."
81+ describeIssue Backward (ResponseHeaderMissing h) =
82+ para $ "Header was removed " <> code h <> "."
79
83
80instance Behavable 'ResponseLevel 'PayloadLevel where
84instance Behavable 'ResponseLevel 'PayloadLevel where
81 data Behave 'ResponseLevel 'PayloadLevel
85 data Behave 'ResponseLevel 'PayloadLevel
src/OpenAPI/Checker/Validate/Schema.hs+53−33
@@ -1057,38 +1057,58 @@ instance Issuable 'TypedSchemaLevel where
1057 NoContradiction
1057 NoContradiction
1058 deriving stock (Eq, Ord, Show)
1058 deriving stock (Eq, Ord, Show)
1059 issueIsUnsupported _ = False
1059 issueIsUnsupported _ = False
1060− describeIssue (EnumDoesntSatisfy v) = para "The following enum value was added:" <> showJSONValue v
1060+ describeIssue Forward (EnumDoesntSatisfy v) = para "The following enum value was added:" <> showJSONValue v
1061+ describeIssue Backward (EnumDoesntSatisfy v) = para "The following enum value was removed:" <> showJSONValue v
1061− describeIssue (NoMatchingEnum v) = para "The following enum value has been removed:" <> showJSONValue v
1062+ describeIssue Forward (NoMatchingEnum v) = para "The following enum value has been removed:" <> showJSONValue v
1063+ describeIssue Backward (NoMatchingEnum v) = para "The following enum value has been added:" <> showJSONValue v
1062− describeIssue (NoMatchingMaximum b) = para $ "Upper bound has been added:" <> showBound b <> "."
1064+ describeIssue Forward (NoMatchingMaximum b) = para $ "Upper bound has been added:" <> showBound b <> "."
1065+ describeIssue Backward (NoMatchingMaximum b) = para $ "Upper bound has been removed:" <> showBound b <> "."
1063− describeIssue (MatchingMaximumWeak (ProdCons p c)) = para $ "Upper bound changed from " <> showBound p <> " to " <> showBound c <> "."
1066+ describeIssue _ (MatchingMaximumWeak (ProdCons p c)) = para $ "Upper bound changed from " <> showBound p <> " to " <> showBound c <> "."
1064− describeIssue (NoMatchingMinimum b) = para $ "Lower bound has been added: " <> showBound b <> "."
1067+ describeIssue Forward (NoMatchingMinimum b) = para $ "Lower bound has been added: " <> showBound b <> "."
1068+ describeIssue Backward (NoMatchingMinimum b) = para $ "Lower bound has been removed: " <> showBound b <> "."
1065− describeIssue (MatchingMinimumWeak (ProdCons p c)) = para $ "Lower bound changed from " <> showBound p <> " to " <> showBound c <> "."
1069+ describeIssue _ (MatchingMinimumWeak (ProdCons p c)) = para $ "Lower bound changed from " <> showBound p <> " to " <> showBound c <> "."
1066− describeIssue (NoMatchingMultipleOf n) = para $ "Value is now a multiple of " <> show' n <> "."
1070+ describeIssue Forward (NoMatchingMultipleOf n) = para $ "Value is now a multiple of " <> show' n <> "."
1071+ describeIssue Backward (NoMatchingMultipleOf n) = para $ "Value is no longer a multiple of " <> show' n <> "."
1067− describeIssue (MatchingMultipleOfWeak (ProdCons p c)) = para $ "Value changed from being a multiple of " <> show' p <> " to being a multiple of " <> show' c <> "."
1072+ describeIssue _ (MatchingMultipleOfWeak (ProdCons p c)) = para $ "Value changed from being a multiple of " <> show' p <> " to being a multiple of " <> show' c <> "."
1068− describeIssue (NoMatchingFormat f) = para $ "Format added: " <> code f <> "."
1073+ describeIssue Forward (NoMatchingFormat f) = para $ "Format added: " <> code f <> "."
1074+ describeIssue Backward (NoMatchingFormat f) = para $ "Format removed: " <> code f <> "."
1069− describeIssue (NoMatchingMaxLength n) = para $ "Maximum length added: " <> show' n <> "."
1075+ describeIssue Forward (NoMatchingMaxLength n) = para $ "Maximum length added: " <> show' n <> "."
1076+ describeIssue Backward (NoMatchingMaxLength n) = para $ "Maximum length removed: " <> show' n <> "."
1070− describeIssue (MatchingMaxLengthWeak (ProdCons p c)) = para $ "Maximum length of the string changed from " <> show' p <> " to " <> show' c <> "."
1077+ describeIssue _ (MatchingMaxLengthWeak (ProdCons p c)) = para $ "Maximum length of the string changed from " <> show' p <> " to " <> show' c <> "."
1071− describeIssue (NoMatchingMinLength n) = para $ "Minimum length of the string added: " <> show' n <> "."
1078+ describeIssue Forward (NoMatchingMinLength n) = para $ "Minimum length of the string added: " <> show' n <> "."
1079+ describeIssue Backward (NoMatchingMinLength n) = para $ "Minimum length of the string removed: " <> show' n <> "."
1072− describeIssue (MatchingMinLengthWeak (ProdCons p c)) = para $ "Minimum length of the string changed from " <> show' p <> " to " <> show' c <> "."
1080+ describeIssue _ (MatchingMinLengthWeak (ProdCons p c)) = para $ "Minimum length of the string changed from " <> show' p <> " to " <> show' c <> "."
1073− describeIssue (NoMatchingPattern p) = para "Pattern (regular expression) added: " <> codeBlock p
1081+ describeIssue Forward (NoMatchingPattern p) = para "Pattern (regular expression) added: " <> codeBlock p
1082+ describeIssue Backward (NoMatchingPattern p) = para "Pattern (regular expression) removed: " <> codeBlock p
1074− describeIssue NoMatchingItems = para "Array item schema has been added."
1083+ describeIssue Forward NoMatchingItems = para "Array item schema has been added."
1084+ describeIssue Backward NoMatchingItems = para "Array item schema has been removed."
1075− describeIssue (NoMatchingMaxItems n) = para $ "Maximum length of the array has been added " <> show' n <> "."
1085+ describeIssue Forward (NoMatchingMaxItems n) = para $ "Maximum length of the array has been added " <> show' n <> "."
1086+ describeIssue Backward (NoMatchingMaxItems n) = para $ "Maximum length of the array has been removed " <> show' n <> "."
1076− describeIssue (MatchingMaxItemsWeak (ProdCons p c)) = para $ "Maximum length of the array changed from " <> show' p <> " to " <> show' c <> "."
1087+ describeIssue _ (MatchingMaxItemsWeak (ProdCons p c)) = para $ "Maximum length of the array changed from " <> show' p <> " to " <> show' c <> "."
1077− describeIssue (NoMatchingMinItems n) = para $ "Minimum length of the array added: " <> show' n <> "."
1088+ describeIssue Forward (NoMatchingMinItems n) = para $ "Minimum length of the array added: " <> show' n <> "."
1089+ describeIssue Backward (NoMatchingMinItems n) = para $ "Minimum length of the array removed: " <> show' n <> "."
1078− describeIssue (MatchingMinItemsWeak (ProdCons p c)) = para $ "Minimum length of the array changed from " <> show' p <> " to " <> show' c <> "."
1090+ describeIssue _ (MatchingMinItemsWeak (ProdCons p c)) = para $ "Minimum length of the array changed from " <> show' p <> " to " <> show' c <> "."
1079− describeIssue NoMatchingUniqueItems = para "Items are now required to be unique."
1091+ describeIssue Forward NoMatchingUniqueItems = para "Items are now required to be unique."
1092+ describeIssue Backward NoMatchingUniqueItems = para "Items are no longer required to be unique."
1080− describeIssue NoMatchingProperties = para "Property added."
1093+ describeIssue Forward NoMatchingProperties = para "Property added."
1094+ describeIssue Backward NoMatchingProperties = para "Property removed."
1081− describeIssue (UnexpectedProperty p) = para $ "Property " <> code p <> " has been removed."
1095+ describeIssue Forward (UnexpectedProperty p) = para $ "Property " <> code p <> " has been removed."
1096+ describeIssue Backward (UnexpectedProperty p) = para $ "Property " <> code p <> " has been added."
1082− describeIssue (PropertyNowRequired p) = para $ "Property " <> code p <> " has become required."
1097+ describeIssue Forward (PropertyNowRequired p) = para $ "Property " <> code p <> " has become required."
1098+ describeIssue Backward (PropertyNowRequired p) = para $ "Property " <> code p <> " may not be present."
1083− describeIssue NoAdditionalProperties = para "Additional properties have been removed."
1099+ describeIssue Forward NoAdditionalProperties = para "Additional properties have been removed."
1100+ describeIssue Backward NoAdditionalProperties = para "Additional properties have been added."
1084− describeIssue (NoMatchingMaxProperties n) = para $ "Maximum number of properties has been added: " <> show' n <> "."
1101+ describeIssue Forward (NoMatchingMaxProperties n) = para $ "Maximum number of properties has been added: " <> show' n <> "."
1102+ describeIssue Backward (NoMatchingMaxProperties n) = para $ "Maximum number of properties has been removed: " <> show' n <> "."
1085− describeIssue (MatchingMaxPropertiesWeak (ProdCons p c)) = para $ "Maximum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
1103+ describeIssue _ (MatchingMaxPropertiesWeak (ProdCons p c)) = para $ "Maximum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
1086− describeIssue (NoMatchingMinProperties n) = para $ "Minimum number of properties added: " <> show' n <> "."
1104+ describeIssue Forward (NoMatchingMinProperties n) = para $ "Minimum number of properties added: " <> show' n <> "."
1105+ describeIssue Backward (NoMatchingMinProperties n) = para $ "Minimum number of properties removed: " <> show' n <> "."
1087− describeIssue (MatchingMinPropertiesWeak (ProdCons p c)) = para $ "Minimum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
1106+ describeIssue _ (MatchingMinPropertiesWeak (ProdCons p c)) = para $ "Minimum number of properties has changed from " <> show' p <> " to " <> show' c <> "."
1088− describeIssue (NoMatchingCondition conds) =
1107+ describeIssue _ (NoMatchingCondition conds) =
1089 para "Expected the following conditions to hold, but they didn't (please file a bug if you see this):"
1108 para "Expected the following conditions to hold, but they didn't (please file a bug if you see this):"
1090 <> bulletList ((\(SomeCondition c) -> showCondition c) <$> conds)
1109 <> bulletList ((\(SomeCondition c) -> showCondition c) <$> conds)
1091− describeIssue NoContradiction = para "The type has been removed."
1110+ describeIssue Forward NoContradiction = para "The type has been removed."
1111+ describeIssue Backward NoContradiction = para "The type has been added."
1092
1112
1093showJSONValue :: A.Value -> Blocks
1113showJSONValue :: A.Value -> Blocks
1094showJSONValue v = codeBlockWith ("", ["json"], mempty) (T.decodeUtf8 . BSL.toStrict . A.encode $ v)
1114showJSONValue v = codeBlockWith ("", ["json"], mempty) (T.decodeUtf8 . BSL.toStrict . A.encode $ v)
@@ -1111,11 +1131,11 @@ instance Issuable 'SchemaLevel where
1111 deriving stock (Eq, Ord, Show)
1131 deriving stock (Eq, Ord, Show)
1112 issueIsUnsupported _ = True
1132 issueIsUnsupported _ = True
1113
1133
1114− describeIssue (NotSupported i) =
1134+ describeIssue _ (NotSupported i) =
1115 para (emph "Encountered a feature that OpenApi Diff does not support: " <> text i <> ".")
1135 para (emph "Encountered a feature that OpenApi Diff does not support: " <> text i <> ".")
1116− describeIssue (InvalidSchema i) =
1136+ describeIssue _ (InvalidSchema i) =
1117 para (emph "The schema is invalid: " <> text i <> ".")
1137 para (emph "The schema is invalid: " <> text i <> ".")
1118− describeIssue UnguardedRecursion =
1138+ describeIssue _ UnguardedRecursion =
1119 para "Encountered recursion that is too complex for OpenApi Diff to untangle."
1139 para "Encountered recursion that is too complex for OpenApi Diff to untangle."
1120
1140
1121instance Behavable 'SchemaLevel 'TypedSchemaLevel where
1141instance Behavable 'SchemaLevel 'TypedSchemaLevel where
src/OpenAPI/Checker/Validate/Server.hs+9−4
@@ -134,13 +134,18 @@ instance Issuable 'ServerLevel where
134 | ServerNotMatched
134 | ServerNotMatched
135 deriving stock (Eq, Ord, Show)
135 deriving stock (Eq, Ord, Show)
136 issueIsUnsupported _ = False
136 issueIsUnsupported _ = False
137− describeIssue (EnumValueNotConsumed _ v) =
137+ describeIssue Forward (EnumValueNotConsumed _ v) =
138 para $ "Enum value " <> code v <> " has been removed."
138 para $ "Enum value " <> code v <> " has been removed."
139+ describeIssue Backward (EnumValueNotConsumed _ v) =
140+ para $ "Enum value " <> code v <> " has been added."
139− describeIssue (ConsumerNotOpen _) =
141+ describeIssue Forward (ConsumerNotOpen _) =
140 para $ "A variable has been changed from being open to being closed."
142 para $ "A variable has been changed from being open to being closed."
143+ describeIssue Backward (ConsumerNotOpen _) =
144+ para $ "A variable has been changed from being closed to being open."
141− describeIssue (ServerVariableNotDefined k) =
145+ describeIssue _ (ServerVariableNotDefined k) =
142 para $ "Variable " <> code k <> " is not defined."
146 para $ "Variable " <> code k <> " is not defined."
143− describeIssue ServerNotMatched = para $ "The server was removed."
147+ describeIssue Forward ServerNotMatched = para $ "The server was removed."
148+ describeIssue Backward ServerNotMatched = para $ "The server was added."
144
149
145instance Subtree ProcessedServer where
150instance Subtree ProcessedServer where
146 type SubtreeLevel ProcessedServer = 'ServerLevel
151 type SubtreeLevel ProcessedServer = 'ServerLevel
stack.yaml+1−1
@@ -1,4 +1,4 @@
1−resolver: nightly-2021-06-10
1+resolver: lts-18.0
2
2
3extra-deps:
3extra-deps:
4 - open-union-0.4.0.0
4 - open-union-0.4.0.0
stack.yaml.lock+4−4
@@ -20,7 +20,7 @@ packages:
20 hackage: type-fun-0.1.3
20 hackage: type-fun-0.1.3
21snapshots:
21snapshots:
22- completed:
22- completed:
23− size: 585361
23+ size: 585393
24− url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2021/6/10.yaml
24+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/0.yaml
25− sha256: ef53458d54ca6084c6d8eb5219d03b38878e999af607cf006d5be86669d9a696
25+ sha256: c632012da648385b9fa3c29f4e0afd56ead299f1c5528ee789058be410e883c0
26− original: nightly-2021-06-10
26+ original: lts-18.0
test/Spec.hs+1−1
@@ -9,4 +9,4 @@ main = defaultMain =<< tests
9tests :: IO TestTree
9tests :: IO TestTree
10tests = do
10tests = do
11 goldenReportTree <- Spec.Golden.TraceTree.tests
11 goldenReportTree <- Spec.Golden.TraceTree.tests
12− return . localOption (mkTimeout 1000000) $ goldenReportTree
12+ return . localOption (mkTimeout 5000000) $ goldenReportTree
test/Spec/Golden/TraceTree.hs+2−17
@@ -7,16 +7,10 @@ import Control.Category
7import Control.Exception
7import Control.Exception
8import qualified Data.ByteString.Lazy as BSL
8import qualified Data.ByteString.Lazy as BSL
9import Data.Default
9import Data.Default
10−import Data.HList
11−import Data.OpenApi
12import Data.Text (Text)
10import Data.Text (Text)
13import qualified Data.Text.Encoding as T
11import qualified Data.Text.Encoding as T
14import qualified Data.Yaml as Yaml
12import qualified Data.Yaml as Yaml
15−import OpenAPI.Checker.Behavior
13+import OpenAPI.Checker.Run
16−import OpenAPI.Checker.Paths
17−import OpenAPI.Checker.PathsPrefixTree
18−import OpenAPI.Checker.Report
19−import OpenAPI.Checker.Subtree
20import OpenAPI.Checker.Validate.OpenApi ()
14import OpenAPI.Checker.Validate.OpenApi ()
21import Spec.Golden.Extra
15import Spec.Golden.Extra
22import Test.Tasty (TestTree, testGroup)
16import Test.Tasty (TestTree, testGroup)
@@ -43,18 +37,9 @@ tests = do
43 "report.md"
37 "report.md"
44 ("a.yaml", "b.yaml")
38 ("a.yaml", "b.yaml")
45 Yaml.decodeFileThrow
39 Yaml.decodeFileThrow
46− (runPandoc . writeMarkdown def {writerExtensions = githubMarkdownExtensions} . generateReport . runChecker)
40+ (runPandoc . writeMarkdown def {writerExtensions = githubMarkdownExtensions} . fst . runReport)
47
41
48 return $ testGroup "Golden tests" [traceTreeTests, reportTests]
42 return $ testGroup "Golden tests" [traceTreeTests, reportTests]
49
43
50runPandoc :: PandocPure Text -> IO BSL.ByteString
44runPandoc :: PandocPure Text -> IO BSL.ByteString
51runPandoc = either throwIO (pure . BSL.fromStrict . T.encodeUtf8) . runPure
45runPandoc = either throwIO (pure . BSL.fromStrict . T.encodeUtf8) . runPure
52−
53−runChecker :: (OpenApi, OpenApi) -> Either (PathsPrefixTree Behave AnIssue 'APILevel) ()
54−runChecker = runCompatFormula . checkCompatibility HNil Root . toPC
55− where
56− toPC (c, s) =
57− ProdCons
58− { producer = traced (step ClientSchema) c
59− , consumer = traced (step ServerSchema) s
60− }
test/golden/common/enum-anyof/report.md+5−1
@@ -1 +1,5 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4+|---------------------|------------------------|-------------------------------|
5+| 0 | 0 | 0 |
test/golden/common/enum-anyof/trace-tree.yaml+2−1
@@ -1 +1,2 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges: {}
test/golden/common/id/report.md+5−1
@@ -1 +1,5 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4+|---------------------|------------------------|-------------------------------|
5+| 0 | 0 | 0 |
test/golden/common/id/trace-tree.yaml+2−1
@@ -1 +1,2 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges: {}
test/golden/common/json/recursive/report.md+5−1
@@ -1 +1,5 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4+|---------------------|------------------------|-------------------------------|
5+| 0 | 0 | 0 |
test/golden/common/json/recursive/trace-tree.yaml+2−1
@@ -1 +1,2 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges: {}
test/golden/common/maximum-lowered/report.md+14−4
@@ -1,14 +1,24 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 1 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
9## **POST** /test
9## **POST** /test
10
10
11−### JSON Request
11+### 📱➡️ JSON Request
12+
13+#### `$(Number)`
14+
15+Upper bound changed from 3.0 inclusive to 2.0 inclusive.
16+
17+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
18+
19+## **POST** /test
20+
21+### 📱⬅️ JSON Response – 200
12
22
13#### `$(Number)`
23#### `$(Number)`
14
24
test/golden/common/maximum-lowered/trace-tree.yaml+9−1
@@ -1,4 +1,4 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -6,3 +6,11 @@ Left:
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:
10+ AtPath "/test":
11+ InOperation PostMethod:
12+ WithStatusCode 200:
13+ ResponsePayload:
14+ PayloadSchema:
15+ OfType Number: MatchingMaximumWeak (ProdCons {producer = Inclusive 3.0,
16+ consumer = Inclusive 2.0})
test/golden/common/pathItem/operation/parameters/allowEmptyValue/reset/report.md+4−4
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -10,4 +10,4 @@
10
10
11### Parameter test1
11### Parameter test1
12
12
13−Expected that an empty parameter is allowed, but it isn't.
13+The parameter can no longer be empty.
test/golden/common/pathItem/operation/parameters/allowEmptyValue/reset/trace-tree.yaml+2−1
@@ -1,4 +1,5 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InParam "test1": ParamEmptinessIncompatible
4 InParam "test1": ParamEmptinessIncompatible
5+nonBreakingChanges: {}
test/golden/common/pathItem/operation/parameters/allowEmptyValue/set/report.md+13−1
@@ -1 +1,13 @@
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
1−# No breaking changes found ✨
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+### Parameter test1
12+
13+The parameter can now be empty.
test/golden/common/pathItem/operation/parameters/allowEmptyValue/set/trace-tree.yaml+5−1
@@ -1 +1,5 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod:
5+ InParam "test1": ParamEmptinessIncompatible
test/golden/common/pathItem/operation/parameters/change/report.md+15−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 1 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -15,3 +15,15 @@
15##### `$(String)`
15##### `$(String)`
16
16
17The type has been removed.
17The type has been removed.
18+
19+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
20+
21+## **POST** /test
22+
23+### Parameter test
24+
25+#### JSON Schema
26+
27+##### `$(Number)`
28+
29+The type has been added.
test/golden/common/pathItem/operation/parameters/change/trace-tree.yaml+7−1
@@ -1,6 +1,12 @@
1−Left:
1+breakingChanges:
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: NoContradiction
6 OfType String: NoContradiction
7+nonBreakingChanges:
8+ AtPath "/test":
9+ InOperation PostMethod:
10+ InParam "test":
11+ InParamSchema:
12+ OfType Number: NoContradiction
test/golden/common/pathItem/operation/parameters/required/false/add/report.md+5−1
@@ -1 +1,5 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4+|---------------------|------------------------|-------------------------------|
5+| 0 | 0 | 0 |
test/golden/common/pathItem/operation/parameters/required/false/add/trace-tree.yaml+2−1
@@ -1 +1,2 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges: {}
test/golden/common/pathItem/operation/parameters/required/false/del/report.md+5−1
@@ -1 +1,5 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4+|---------------------|------------------------|-------------------------------|
5+| 0 | 0 | 0 |
test/golden/common/pathItem/operation/parameters/required/false/del/trace-tree.yaml+2−1
@@ -1 +1,2 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges: {}
test/golden/common/pathItem/operation/parameters/required/reset/report.md+13−1
@@ -1 +1,13 @@
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
1−# No breaking changes found ✨
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+### Parameter test1
12+
13+Parameter is no longer required.
test/golden/common/pathItem/operation/parameters/required/reset/trace-tree.yaml+5−1
@@ -1 +1,5 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod:
5+ InParam "test1": ParamRequired
test/golden/common/pathItem/operation/parameters/required/set/report.md+3−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
test/golden/common/pathItem/operation/parameters/required/set/trace-tree.yaml+2−1
@@ -1,4 +1,5 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InParam "test1": ParamRequired
4 InParam "test1": ParamRequired
5+nonBreakingChanges: {}
test/golden/common/pathItem/operation/parameters/required/true/add/report.md+3−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
test/golden/common/pathItem/operation/parameters/required/true/add/trace-tree.yaml+2−1
@@ -1,3 +1,4 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod: ParamNotMatched "test2"
3 InOperation PostMethod: ParamNotMatched "test2"
4+nonBreakingChanges: {}
test/golden/common/pathItem/operation/parameters/required/true/del/report.md+11−1
@@ -1 +1,11 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+Parameter `test2` is no longer required.
test/golden/common/pathItem/operation/parameters/required/true/del/trace-tree.yaml+4−1
@@ -1 +1,4 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod: ParamNotMatched "test2"
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/add/report.md+13−1
@@ -1 +1,13 @@
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
1−# No breaking changes found ✨
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+### Request
12+
13+Media type `application/x-www-form-urlencoded` has been added.
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/add/trace-tree.yaml+5−1
@@ -1 +1,5 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod:
5+ InRequest: RequestMediaTypeNotFound application/x-www-form-urlencoded
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/change/report.md+14−4
@@ -1,15 +1,25 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 1 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
9## **POST** /test
9## **POST** /test
10
10
11−### JSON Request
11+### 📱➡️ JSON Request
12
12
13#### `$(String)`
13#### `$(String)`
14
14
15The type has been removed.
15The type has been removed.
16+
17+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
18+
19+## **POST** /test
20+
21+### 📱➡️ JSON Request
22+
23+#### `$(Number)`
24+
25+The type has been added.
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/change/trace-tree.yaml+8−1
@@ -1,7 +1,14 @@
1−Left:
1+breakingChanges:
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: NoContradiction
7 OfType String: NoContradiction
8+nonBreakingChanges:
9+ AtPath "/test":
10+ InOperation PostMethod:
11+ InRequest:
12+ InPayload:
13+ PayloadSchema:
14+ OfType Number: NoContradiction
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/del/report.md+3−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
test/golden/common/pathItem/operation/requestBody/mediaTypeObject/del/trace-tree.yaml+2−1
@@ -1,4 +1,5 @@
1−Left:
1+breakingChanges:
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: {}
test/golden/common/pathItem/operation/requestBody/required/reset/report.md+13−1
@@ -1 +1,13 @@
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
1−# No breaking changes found ✨
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+### Request
12+
13+Request body is no longer required.
test/golden/common/pathItem/operation/requestBody/required/reset/trace-tree.yaml+5−1
@@ -1 +1,5 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod:
5+ InRequest: RequestBodyRequired
test/golden/common/pathItem/operation/requestBody/required/set/report.md+3−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
test/golden/common/pathItem/operation/requestBody/required/set/trace-tree.yaml+2−1
@@ -1,4 +1,5 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest: RequestBodyRequired
4 InRequest: RequestBodyRequired
5+nonBreakingChanges: {}
test/golden/common/pathItem/operation/responses/add/report.md+3−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
test/golden/common/pathItem/operation/responses/add/trace-tree.yaml+2−1
@@ -1,3 +1,4 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod: ResponseCodeNotFound 500
3 InOperation PostMethod: ResponseCodeNotFound 500
4+nonBreakingChanges: {}
test/golden/common/pathItem/operation/responses/change/headers/mandatory/add/report.md+13−1
@@ -1 +1,13 @@
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
1−# No breaking changes found ✨
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+### Response code 200
12+
13+New header was added `Test2`.
test/golden/common/pathItem/operation/responses/change/headers/mandatory/add/trace-tree.yaml+5−1
@@ -1 +1,5 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod:
5+ WithStatusCode 200: ResponseHeaderMissing "Test2"
test/golden/common/pathItem/operation/responses/change/headers/mandatory/del/report.md+4−4
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -10,4 +10,4 @@
10
10
11### Response code 200
11### Response code 200
12
12
13−New header was added `Test2`.
13+Header was removed `Test2`.
test/golden/common/pathItem/operation/responses/change/headers/mandatory/del/trace-tree.yaml+2−1
@@ -1,4 +1,5 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200: ResponseHeaderMissing "Test2"
4 WithStatusCode 200: ResponseHeaderMissing "Test2"
5+nonBreakingChanges: {}
test/golden/common/pathItem/operation/responses/change/headers/optional/add/report.md+5−1
@@ -1 +1,5 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4+|---------------------|------------------------|-------------------------------|
5+| 0 | 0 | 0 |
test/golden/common/pathItem/operation/responses/change/headers/optional/add/trace-tree.yaml+2−1
@@ -1 +1,2 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges: {}
test/golden/common/pathItem/operation/responses/change/headers/optional/del/report.md+5−1
@@ -1 +1,5 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4+|---------------------|------------------------|-------------------------------|
5+| 0 | 0 | 0 |
test/golden/common/pathItem/operation/responses/change/headers/optional/del/trace-tree.yaml+2−1
@@ -1 +1,2 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges: {}
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/add/report.md+3−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | 🙆 Non-breaking changes | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 0 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/add/trace-tree.yaml+2−1
@@ -1,4 +1,5 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 WithStatusCode 200: ResponseMediaTypeMissing application/x-www-form-urlencoded
4 WithStatusCode 200: ResponseMediaTypeMissing application/x-www-form-urlencoded
5+nonBreakingChanges: {}
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/change/report.md+14−4
@@ -1,15 +1,25 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 1 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
9## **POST** /test
9## **POST** /test
10
10
11−### JSON Response – 200
11+### 📱⬅️ JSON Response – 200
12
12
13#### `$(Number)`
13#### `$(Number)`
14
14
15+The type has been added.
16+
17+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
18+
19+## **POST** /test
20+
21+### 📱⬅️ JSON Response – 200
22+
23+#### `$(String)`
24+
15The type has been removed.
25The type has been removed.
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/change/trace-tree.yaml+8−1
@@ -1,7 +1,14 @@
1−Left:
1+breakingChanges:
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: NoContradiction
7 OfType Number: NoContradiction
8+nonBreakingChanges:
9+ AtPath "/test":
10+ InOperation PostMethod:
11+ WithStatusCode 200:
12+ ResponsePayload:
13+ PayloadSchema:
14+ OfType String: NoContradiction
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/del/report.md+13−1
@@ -1 +1,13 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+### Response code 200
12+
13+Media type was removed: `application/x-www-form-urlencoded`.
test/golden/common/pathItem/operation/responses/change/mediaTypeObject/del/trace-tree.yaml+5−1
@@ -1 +1,5 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod:
5+ WithStatusCode 200: ResponseMediaTypeMissing application/x-www-form-urlencoded
test/golden/common/pathItem/operation/responses/del/report.md+11−1
@@ -1 +1,11 @@
1−# No breaking changes found ✨
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **POST** /test
10+
11+Reponse code 500 has been removed.
test/golden/common/pathItem/operation/responses/del/trace-tree.yaml+4−1
@@ -1 +1,4 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/test":
4+ InOperation PostMethod: ResponseCodeNotFound 500
test/golden/common/property-removed-additional/a.yamlnew file+32
@@ -0,0 +1,32 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ "200":
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ required:
26+ - property1
27+ - property2
28+ properties:
29+ property1:
30+ type: string
31+ property2:
32+ type: number
test/golden/common/property-removed-additional/b.yamlnew file+29
@@ -0,0 +1,29 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ "200":
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ required:
26+ - property1
27+ properties:
28+ property1:
29+ type: string
test/golden/common/property-removed-additional/report.mdnew file+25
@@ -0,0 +1,25 @@
1+# Summary
2+
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5+| 1 | 1 | 0 |
6+
7+# <span id="breaking-changes"></span>⚠️ Breaking changes
8+
9+## **POST** /test
10+
11+### 📱⬅️ JSON Response – 200
12+
13+#### `$(Object)`
14+
15+Property `property2` may not be present.
16+
17+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
18+
19+## **POST** /test
20+
21+### 📱➡️ JSON Request
22+
23+#### `$(Object)`
24+
25+Property `property2` may not be present.
test/golden/common/property-removed-additional/trace-tree.yamlnew file+14
@@ -0,0 +1,14 @@
1+breakingChanges:
2+ AtPath "/test":
3+ InOperation PostMethod:
4+ WithStatusCode 200:
5+ ResponsePayload:
6+ PayloadSchema:
7+ OfType Object: PropertyNowRequired "property2"
8+nonBreakingChanges:
9+ AtPath "/test":
10+ InOperation PostMethod:
11+ InRequest:
12+ InPayload:
13+ PayloadSchema:
14+ OfType Object: PropertyNowRequired "property2"
test/golden/common/property-removed/report.md+22−6
@@ -1,21 +1,37 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 2 | 0 |
5+| 2 | 2 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
9## **POST** /test
9## **POST** /test
10
10
11−### JSON Request
11+### 📱➡️ JSON Request
12
12
13#### `$(Object)`
13#### `$(Object)`
14
14
15Property `property2` has been removed.
15Property `property2` has been removed.
16
16
17−### JSON Response – 200
17+### 📱⬅️ JSON Response – 200
18
18
19#### `$(Object)`
19#### `$(Object)`
20
20
21−Property `property2` has become required.
21+Property `property2` 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+#### `$(Object)`
30+
31+Property `property2` may not be present.
32+
33+### 📱⬅️ JSON Response – 200
34+
35+#### `$(Object)`
36+
37+Property `property2` has been removed.
test/golden/common/property-removed/trace-tree.yaml+12−1
@@ -1,4 +1,4 @@
1−Left:
1+breakingChanges:
2 AtPath "/test":
2 AtPath "/test":
3 InOperation PostMethod:
3 InOperation PostMethod:
4 InRequest:
4 InRequest:
@@ -9,3 +9,14 @@ Left:
9 ResponsePayload:
9 ResponsePayload:
10 PayloadSchema:
10 PayloadSchema:
11 OfType Object: PropertyNowRequired "property2"
11 OfType Object: PropertyNowRequired "property2"
12+nonBreakingChanges:
13+ AtPath "/test":
14+ InOperation PostMethod:
15+ InRequest:
16+ InPayload:
17+ PayloadSchema:
18+ OfType Object: PropertyNowRequired "property2"
19+ WithStatusCode 200:
20+ ResponsePayload:
21+ PayloadSchema:
22+ OfType Object: UnexpectedProperty "property2"
test/golden/common/property-required/report.md+14−4
@@ -1,14 +1,24 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 1 | 0 |
5+| 1 | 1 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
9## **POST** /test
9## **POST** /test
10
10
11−### JSON Request
11+### 📱➡️ JSON Request
12+
13+#### `$(Object)`
14+
15+Property `property2` has become required.
16+
17+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
18+
19+## **POST** /test
20+
21+### 📱⬅️ JSON Response – 200
12
22
13#### `$(Object)`
23#### `$(Object)`
14
24
test/golden/common/property-required/trace-tree.yaml+8−1
@@ -1,7 +1,14 @@
1−Left:
1+breakingChanges:
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 Object: PropertyNowRequired "property2"
7 OfType Object: PropertyNowRequired "property2"
8+nonBreakingChanges:
9+ AtPath "/test":
10+ InOperation PostMethod:
11+ WithStatusCode 200:
12+ ResponsePayload:
13+ PayloadSchema:
14+ OfType Object: PropertyNowRequired "property2"
test/golden/common/recursive/report.md+19−1
@@ -1 +1,19 @@
1+# Summary
2+
3+| ⚠️ Breaking changes | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4+|---------------------|-------------------------------------------------|-------------------------------|
5+| 0 | 1 | 0 |
6+
1−# No breaking changes found ✨
7+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
8+
9+## **GET** /api/foo
10+
11+### 📱⬅️ JSON Response – 200
12+
13+#### `$.leaf.value.foo(String)`
14+
15+The following enum value has been removed:
16+
17+``` json
18+"a"
19+```
test/golden/common/recursive/trace-tree.yaml+14−1
@@ -1 +1,14 @@
1−Right: []
1+breakingChanges: {}
2+nonBreakingChanges:
3+ AtPath "/api/foo":
4+ InOperation GetMethod:
5+ WithStatusCode 200:
6+ ResponsePayload:
7+ PayloadSchema:
8+ OfType Object:
9+ InProperty "leaf":
10+ OfType Object:
11+ InProperty "value":
12+ OfType Object:
13+ InProperty "foo":
14+ OfType String: NoMatchingEnum (String "a")
test/golden/common/security-scheme/report.md+13−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 2 | 0 |
5+| 2 | 1 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -21,3 +21,13 @@ Security scheme has been removed.
21#### oauth
21#### oauth
22
22
23Security scheme has been removed.
23Security scheme has been removed.
24+
25+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
26+
27+## **POST** /oauth/check
28+
29+### Security requirement 0
30+
31+#### spa-oauth
32+
33+Security scheme has been added.
test/golden/common/security-scheme/trace-tree.yaml+6−1
@@ -1,4 +1,4 @@
1−Left:
1+breakingChanges:
2 AtPath "/oauth/sign_out":
2 AtPath "/oauth/sign_out":
3 InOperation GetMethod:
3 InOperation GetMethod:
4 SecurityRequirementStep 1:
4 SecurityRequirementStep 1:
@@ -7,3 +7,8 @@ Left:
7 InOperation PostMethod:
7 InOperation PostMethod:
8 SecurityRequirementStep 0:
8 SecurityRequirementStep 0:
9 SecuritySchemeStep "oauth": SecuritySchemeNotMatched
9 SecuritySchemeStep "oauth": SecuritySchemeNotMatched
10+nonBreakingChanges:
11+ AtPath "/oauth/check":
12+ InOperation PostMethod:
13+ SecurityRequirementStep 0:
14+ SecuritySchemeStep "spa-oauth": SecuritySchemeNotMatched
test/golden/common/servers/report.md+11−3
@@ -1,8 +1,8 @@
1# Summary
1# Summary
2
2
3−| [⚠️ Breaking changes](#breaking-changes) | 🤷 Unsupported feature changes |
3+| [⚠️ Breaking changes](#breaking-changes) | [🙆 Non-breaking changes](#non-breaking-changes) | 🤷 Unsupported feature changes |
4−|------------------------------------------|-------------------------------|
4+|------------------------------------------|-------------------------------------------------|-------------------------------|
5−| 3 | 0 |
5+| 3 | 1 | 0 |
6
6
7# <span id="breaking-changes"></span>⚠️ Breaking changes
7# <span id="breaking-changes"></span>⚠️ Breaking changes
8
8
@@ -17,3 +17,11 @@ The server was removed.
17Enum value `a` has been removed.
17Enum value `a` has been removed.
18
18
19A variable has been changed from being open to being closed.
19A variable has been changed from being open to being closed.
20+
21+# <span id="non-breaking-changes"></span>🙆 Non-breaking changes
22+
23+## **GET** /pets
24+
25+### Server `http://{x}variable.path/{y}/{openVariable1}/{openVariable2}`
26+
27+Enum value `bbb` has been added.
test/golden/common/servers/trace-tree.yaml+6−1
@@ -1,7 +1,12 @@
1−Left:
1+breakingChanges:
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:
9+ AtPath "/pets":
10+ InOperation GetMethod:
11+ InServer "http://{x}variable.path/{y}/{openVariable1}/{openVariable2}": EnumValueNotConsumed
12+ 3 "bbb"
test/golden/common/unguarded-recursive/report.md+4−4
@@ -1,13 +1,13 @@
1# Summary
1# Summary
2
2
3−| ⚠️ Breaking changes | [🤷 Unsupported feature changes](#unsupported-changes) |
3+| ⚠️ Breaking changes | 🙆 Non-breaking changes | [🤷 Unsupported feature changes](#unsupported-changes) |
4−|---------------------|-------------------------------------------------------|
4+|---------------------|------------------------|-------------------------------------------------------|
5−| 0 | 1 |
5+| 0 | 0 | 1 |
6
6
7# <span id="unsupported-changes"></span>🤷 Unsupported feature changes
7# <span id="unsupported-changes"></span>🤷 Unsupported feature changes
8
8
9## **GET** /api/foo
9## **GET** /api/foo
10
10
11−### JSON Response – 200
11+### 📱⬅️ JSON Response – 200
12
12
13Encountered recursion that is too complex for OpenApi Diff to untangle.
13Encountered recursion that is too complex for OpenApi Diff to untangle.
test/golden/common/unguarded-recursive/trace-tree.yaml+7−1
@@ -1,4 +1,10 @@
1−Left:
1+breakingChanges:
2+ AtPath "/api/foo":
3+ InOperation GetMethod:
4+ WithStatusCode 200:
5+ ResponsePayload:
6+ PayloadSchema: UnguardedRecursion
7+nonBreakingChanges:
2 AtPath "/api/foo":
8 AtPath "/api/foo":
3 InOperation GetMethod:
9 InOperation GetMethod:
4 WithStatusCode 200:
10 WithStatusCode 200: