git.iko.soy/typeable/compaREST
on master help sign in
Added Operation processing (#30)

* Added Operation processing * Added module to cabal

commit4891a15750fae987b11530fb25f806db6499d9b9 authoriko <ilyakooo0@gmail.com> dateFri 2 Apr 2021, 12:20 (6 years ago) parent7dface8
10 files changed+376−150
openapi-diff.cabal+5 src/Data/HList.hs+2 src/OpenAPI/Checker/Subtree.hs+13 src/OpenAPI/Checker/Validate/OpenApi.hs+13−148 src/OpenAPI/Checker/Validate/Operation.hs+97−2 src/OpenAPI/Checker/Validate/ProcessedPathItem.hs+181 src/OpenAPI/Checker/Validate/RequestBody.hs+16 src/OpenAPI/Checker/Validate/Responses.hs+14 src/OpenAPI/Checker/Validate/SecurityRequirement.hs+19 src/OpenAPI/Checker/Validate/Server.hs+16
openapi-diff.cabal+5
@@ -106,6 +106,11 @@ library
106106 , OpenAPI.Checker.Validate.Operation
107107 , OpenAPI.Checker.Validate.Param
108108 , OpenAPI.Checker.Validate.PathFragment
109+ , OpenAPI.Checker.Validate.RequestBody
110+ , OpenAPI.Checker.Validate.Responses
111+ , OpenAPI.Checker.Validate.ProcessedPathItem
112+ , OpenAPI.Checker.Validate.Server
113+ , OpenAPI.Checker.Validate.SecurityRequirement
109114
110115executable openapi-diff
111116 import: common-options
src/Data/HList.hs+2
@@ -14,6 +14,8 @@ data HList (xs :: [Type]) where
1414 HNil :: HList '[]
1515 HCons :: x -> HList xs -> HList (x ': xs)
1616
17+infixr 5 `HCons`
18+
1719type family HasAll xs ys :: Constraint where
1820 HasAll '[] _ = ()
1921 HasAll (x ': xs) ys = (Has x ys, HasAll xs ys)
src/OpenAPI/Checker/Subtree.hs+13
@@ -5,9 +5,11 @@ module OpenAPI.Checker.Subtree
55 , CompatFormula
66 , ProdCons (..)
77 , HasUnsupportedFeature (..)
8+ , checkProdCons
89 , runCompatFormula
910 , localM
1011 , localTrace
12+ , localStep
1113 , anyOfM
1214 , anyOfAt
1315 , issueAtTrace
@@ -77,6 +79,10 @@ class (Typeable t, Ord (CheckIssue t), Show (CheckIssue t)) => Subtree (t :: Typ
7779
7880 checkCompatibility :: HasAll (CheckEnv t) xs => HList xs -> ProdCons t -> CompatFormula t ()
7981
82+checkProdCons :: (Subtree t, HasAll (CheckEnv t) env) => HList env -> ProdCons (Traced r t) -> CompatFormula r ()
83+checkProdCons env (ProdCons (Traced p x) (Traced c y)) =
84+ localTrace (ProdCons p c) $ checkCompatibility env $ ProdCons x y
85+
8086class HasUnsupportedFeature x where
8187 hasUnsupportedFeature :: x -> Bool
8288
@@ -136,6 +142,13 @@ localTrace
136142 -> Compose (CompatM a) (FormulaF f r) x
137143localTrace xs (Compose h) = Compose (localM xs h)
138144
145+localStep
146+ :: Steppable a b
147+ => Step a b
148+ -> Compose (CompatM b) (FormulaF f r) x
149+ -> Compose (CompatM a) (FormulaF f r) x
150+localStep xs (Compose h) = Compose (localM (pure $ step xs) h)
151+
139152issueAtTrace
140153 :: Subtree t => Trace OpenApi t -> CheckIssue t -> CompatFormula t a
141154issueAtTrace xs issue = Compose $ pure $ anError $ AnItem xs $ SubtreeCheckIssue issue
src/OpenAPI/Checker/Validate/OpenApi.hs+13−148
@@ -6,163 +6,28 @@ module OpenAPI.Checker.Validate.OpenApi
66 )
77where
88
9−import Data.Foldable
109import Data.HList
1110import qualified Data.HashMap.Strict.InsOrd as IOHM
12−import Data.Maybe
1311import Data.OpenApi
14−import Generic.Data
1512import OpenAPI.Checker.Subtree
1613import OpenAPI.Checker.Trace
17−import OpenAPI.Checker.Validate.Operation
18−import OpenAPI.Checker.Validate.PathFragment
14+import OpenAPI.Checker.Validate.ProcessedPathItem
1915
2016instance Subtree OpenApi where
2117 type CheckEnv OpenApi = '[]
22− data CheckIssue OpenApi = NoPathsMatched | WrongNumberOfFragments
18+ data CheckIssue OpenApi
2319 deriving (Eq, Ord, Show)
2420 normalizeTrace = undefined
2521 checkCompatibility _ prodCons = do
26− let ProdCons {producer = p, consumer = c} = processOpenApi <$> prodCons
27− sequenceA_
28− [ anyOfAt
29− producer
30− NoPathsMatched
31− [ localTrace (step <$> ProdCons pSPath cSPath) $ do
32− -- make sure every path fragment is compatible
33− sequenceA_
34− [ localTrace (pure . step $ PathFragmentStep i) $
35− checkCompatibility (singletonH $ ProdCons pPathFragmentParams cPathFragmentParams) pair
36− | (i, pair) <- zip [0 ..] pathFragments
37− ]
38− -- make sure the operation is compatible.
39− localTrace (pure . step $ getter stepProcessedPathItem) $
40− checkCompatibility HNil $ ProdCons pOperation cOperation
41− pure ()
42− | (cSPath, cPath, cPathItem) <- c
43− , -- ... and try to match it with every endpoint in the consumer.
44− --
45− -- This is required because the meaning of path fragments can change on
46− -- a per-method basis even within the same 'PathItem'
47− --
48− -- Here we only need to look for the method that the current producer
49− -- endpoint is using.
50− (cParams, cOperation) <- maybeToList $ getter cPathItem
51− , let cPathFragmentParams = retrace (step PathFragmentParentStep >>>) <$> cParams
52− , -- make sure the paths are the same length
53− pathFragments <- maybeToList $ zipAllWith ProdCons pPath cPath
54− ]
55− | (pSPath, pPath, pPathItem) <- p
56− , -- look at every endpoint in the producer ...
57− (ProcessedPathItemGetter getter, (pParams, pOperation)) <-
58− toList (fmap . (,) <$> processedPathItemGetters <*> pPathItem) >>= maybeToList
59− , let pPathFragmentParams = retrace (step PathFragmentParentStep >>>) <$> pParams
60− ]
61−
62−zipAllWith :: (a -> b -> c) -> [a] -> [b] -> Maybe [c]
63−zipAllWith _ [] [] = Just []
64−zipAllWith f (x : xs) (y : ys) = (f x y :) <$> zipAllWith f xs ys
65−zipAllWith _ (_ : _) [] = Nothing
66−zipAllWith _ [] (_ : _) = Nothing
67−
68−processOpenApi
69− :: OpenApi
70− -> [ ( Step OpenApi PathItem
71− , [PathFragment]
72− , ForeachOperation (Maybe (TracedReferences PathItem Param, Operation))
73− )
74− ]
75−processOpenApi o = do
76− let cs = _openApiComponents o
77− (pathS, pathItem) <- IOHM.toList . _openApiPaths $ o
78− let path = parsePath pathS
79− componentParams = _componentsParameters cs
80− commonPathParams =
81− retrace (step PathItemParametersStep >>>)
82− <$> getPathParamRefs componentParams (_pathItemParameters pathItem)
83− processOperation (s :: Step PathItem Operation) op =
84− let operationParams =
85− retrace (Root `Snoc` s `Snoc` OperationParametersStep >>>)
86− <$> getPathParamRefs componentParams (_operationParameters op)
87− pathParams =
88− operationParams <> commonPathParams
89− in (pathParams, op)
90− pure
91− ( PathStep pathS
92− , path
93− , fmap . processOperation
94− <$> stepProcessedPathItem
95− <*> ForeachOperation
96− { processedPathItemGet = _pathItemGet pathItem
97− , processedPathItemPut = _pathItemPut pathItem
98− , processedPathItemPost = _pathItemPost pathItem
99− , processedPathItemDelete = _pathItemDelete pathItem
100− , processedPathItemOptions = _pathItemOptions pathItem
101− , processedPathItemHead = _pathItemHead pathItem
102− , processedPathItemPatch = _pathItemPatch pathItem
103− , processedPathItemTrace = _pathItemTrace pathItem
104− }
105− )
106−
107−instance Steppable OpenApi PathItem where
108− data Step OpenApi PathItem = PathStep FilePath
109− deriving (Eq, Ord, Show)
110−
111−instance Steppable PathItem PathFragment where
112− data Step PathItem PathFragment
113− = -- | The index of the path item
114− PathFragmentStep Int
115− deriving (Eq, Ord, Show)
116−
117−instance Steppable PathFragment PathItem where
118− data Step PathFragment PathItem = PathFragmentParentStep
22+ let cs = _openApiComponents <$> prodCons
23+ localStep OpenApiPathsStep $
24+ checkCompatibility
25+ ((_componentsRequestBodies <$> cs)
26+ `HCons` (_componentsParameters <$> cs)
27+ `HCons` (_componentsSecuritySchemes <$> cs)
28+ `HCons` HNil)
29+ (processPathItems . IOHM.toList . _openApiPaths <$> prodCons)
30+
31+instance Steppable OpenApi ProcessedPathItems where
32+ data Step OpenApi ProcessedPathItems = OpenApiPathsStep
11933 deriving (Eq, Ord, Show)
120−
121−instance Steppable PathItem (Referenced Param) where
122− data Step PathItem (Referenced Param) = PathItemParametersStep
123− deriving (Eq, Ord, Show)
124−
125−instance Steppable Operation (Referenced Param) where
126− data Step Operation (Referenced Param) = OperationParametersStep
127− deriving (Eq, Ord, Show)
128−
129−data ForeachOperation a = ForeachOperation
130− { processedPathItemGet :: a
131− , processedPathItemPut :: a
132− , processedPathItemPost :: a
133− , processedPathItemDelete :: a
134− , processedPathItemOptions :: a
135− , processedPathItemHead :: a
136− , processedPathItemPatch :: a
137− , processedPathItemTrace :: a
138− }
139− deriving stock (Functor, Generic1)
140− deriving (Applicative, Foldable) via Generically1 ForeachOperation
141−
142−newtype ProcessedPathItemGetter = ProcessedPathItemGetter (forall a. ForeachOperation a -> a)
143−
144−processedPathItemGetters :: ForeachOperation ProcessedPathItemGetter
145−processedPathItemGetters =
146− ForeachOperation
147− { processedPathItemGet = ProcessedPathItemGetter processedPathItemGet
148− , processedPathItemPut = ProcessedPathItemGetter processedPathItemPut
149− , processedPathItemPost = ProcessedPathItemGetter processedPathItemPost
150− , processedPathItemDelete = ProcessedPathItemGetter processedPathItemDelete
151− , processedPathItemOptions = ProcessedPathItemGetter processedPathItemOptions
152− , processedPathItemHead = ProcessedPathItemGetter processedPathItemHead
153− , processedPathItemPatch = ProcessedPathItemGetter processedPathItemPatch
154− , processedPathItemTrace = ProcessedPathItemGetter processedPathItemTrace
155− }
156−
157−stepProcessedPathItem :: ForeachOperation (Step PathItem Operation)
158−stepProcessedPathItem =
159− ForeachOperation
160− { processedPathItemGet = GetStep
161− , processedPathItemPut = PutStep
162− , processedPathItemPost = PostStep
163− , processedPathItemDelete = DeleteStep
164− , processedPathItemOptions = OptionsStep
165− , processedPathItemHead = HeadStep
166− , processedPathItemPatch = PatchStep
167− , processedPathItemTrace = TraceStep
168− }
src/OpenAPI/Checker/Validate/Operation.hs+97−2
@@ -2,16 +2,91 @@
22
33module OpenAPI.Checker.Validate.Operation (Step (..)) where
44
5+import Data.Foldable
6+import Data.HList
7+import qualified Data.HashMap.Strict.InsOrd as IOHM
58import Data.OpenApi
9+import Data.Text (Text)
10+import OpenAPI.Checker.References
611import OpenAPI.Checker.Subtree
712import OpenAPI.Checker.Trace
13+import OpenAPI.Checker.Validate.Param ()
14+import OpenAPI.Checker.Validate.RequestBody ()
15+import OpenAPI.Checker.Validate.Responses ()
16+import OpenAPI.Checker.Validate.SecurityRequirement ()
17+import OpenAPI.Checker.Validate.Server ()
818
919instance Subtree Operation where
10− type CheckEnv Operation = '[]
20+ type
21+ CheckEnv Operation =
22+ '[ ProdCons (Definitions Param)
23+ , ProdCons (Definitions RequestBody)
24+ , ProdCons (Definitions SecurityScheme)
25+ ]
1126 data CheckIssue Operation
27+ = ParamNotMatched Text -- Param name
28+ | NoRequestBody
29+ | CallbacksNotSupported
30+ | SecurityRequirementNotMet Int -- security indexs
31+ | ServerNotConsumed Int -- server index
1232 deriving (Eq, Ord, Show)
1333 normalizeTrace = undefined
14− checkCompatibility = undefined
34+ checkCompatibility env prodCons = do
35+ let ProdCons {producer = pNonPathParams, consumer = cNonPathParams} = do
36+ op <- _operationParameters <$> prodCons
37+ defParams <- getH @(ProdCons (Definitions Param)) env
38+ pure $
39+ filter ((/= ParamPath) . _paramIn . getTraced)
40+ . fmap (dereferenceTraced defParams)
41+ $ op
42+ reqBody = do
43+ op <- _operationRequestBody <$> prodCons
44+ reqDefs <- getH @(ProdCons (Definitions RequestBody)) env
45+ pure $ fmap (dereferenceTraced reqDefs) op
46+ for_ pNonPathParams $ \p@(Traced _ param) ->
47+ anyOfAt
48+ producer
49+ (ParamNotMatched $ _paramName param)
50+ [ checkProdCons HNil . fmap (retrace (step OperationParamsStep >>>)) $ ProdCons p c
51+ | c <- cNonPathParams
52+ ]
53+ case reqBody of
54+ ProdCons Nothing Nothing -> pure ()
55+ ProdCons (Just pBody) (Just cBody) ->
56+ localStep OperationRequestBodyStep $
57+ checkProdCons HNil (ProdCons pBody cBody)
58+ ProdCons Nothing (Just _) -> issueAt producer NoRequestBody
59+ ProdCons (Just _) Nothing -> issueAt consumer NoRequestBody
60+ localStep OperationResponsesStep $
61+ checkCompatibility HNil $ _operationResponses <$> prodCons
62+ -- FIXME: https://github.com/typeable/openapi-diff/issues/27
63+ case IOHM.null . _operationCallbacks <$> prodCons of
64+ (ProdCons True True) -> pure ()
65+ (ProdCons False _) -> issueAt producer CallbacksNotSupported
66+ (ProdCons _ False) -> issueAt consumer CallbacksNotSupported
67+ -- FIXME: https://github.com/typeable/openapi-diff/issues/28
68+ sequenceA_
69+ [ anyOfAt
70+ producer
71+ (SecurityRequirementNotMet i)
72+ [ localStep OperationSecurityRequirementStep $
73+ checkCompatibility env $ ProdCons prodSecurity consSecurity
74+ | consSecurity <- _operationSecurity . consumer $ prodCons
75+ ]
76+ | (i, prodSecurity) <- zip [0 ..] . _operationSecurity . producer $ prodCons
77+ ]
78+ -- FIXME: https://github.com/typeable/openapi-diff/issues/29s
79+ sequenceA_
80+ [ anyOfAt
81+ producer
82+ (ServerNotConsumed i)
83+ [ localStep OperationServerStep $
84+ checkCompatibility env $ ProdCons pServer cServer
85+ | cServer <- _operationServers . consumer $ prodCons
86+ ]
87+ | (i, pServer) <- zip [0 ..] . _operationServers . producer $ prodCons
88+ ]
89+ pure ()
1590
1691instance Steppable PathItem Operation where
1792 data Step PathItem Operation
@@ -24,3 +99,23 @@ instance Steppable PathItem Operation where
2499 | PatchStep
25100 | TraceStep
26101 deriving (Eq, Ord, Show)
102+
103+instance Steppable Operation (Referenced Param) where
104+ data Step Operation (Referenced Param) = OperationParamsStep
105+ deriving (Eq, Ord, Show)
106+
107+instance Steppable Operation (Referenced RequestBody) where
108+ data Step Operation (Referenced RequestBody) = OperationRequestBodyStep
109+ deriving (Eq, Ord, Show)
110+
111+instance Steppable Operation Responses where
112+ data Step Operation Responses = OperationResponsesStep
113+ deriving (Eq, Ord, Show)
114+
115+instance Steppable Operation SecurityRequirement where
116+ data Step Operation SecurityRequirement = OperationSecurityRequirementStep
117+ deriving (Eq, Ord, Show)
118+
119+instance Steppable Operation Server where
120+ data Step Operation Server = OperationServerStep
121+ deriving (Eq, Ord, Show)
src/OpenAPI/Checker/Validate/ProcessedPathItem.hsnew file+181
@@ -0,0 +1,181 @@
1+{-# OPTIONS_GHC -Wno-orphans #-}
2+
3+module OpenAPI.Checker.Validate.ProcessedPathItem
4+ ( ProcessedPathItem (..)
5+ , ProcessedPathItems (..)
6+ , processPathItems
7+ , Step (..)
8+ )
9+where
10+
11+import Data.Foldable
12+import Data.HList
13+import Data.Maybe
14+import Data.OpenApi
15+import Generic.Data
16+import OpenAPI.Checker.References
17+import OpenAPI.Checker.Subtree
18+import OpenAPI.Checker.Trace
19+import OpenAPI.Checker.Validate.Operation
20+import OpenAPI.Checker.Validate.PathFragment
21+
22+-- FIXME: There's probably a better name for this, but `PathItem` is already taken ;(
23+data ProcessedPathItem = ProcessedPathItem
24+ { path :: FilePath
25+ , item :: PathItem
26+ }
27+
28+processPathItems :: [(FilePath, PathItem)] -> ProcessedPathItems
29+processPathItems = ProcessedPathItems . fmap (uncurry ProcessedPathItem)
30+
31+newtype ProcessedPathItems = ProcessedPathItems {unProcessedPathItems :: [ProcessedPathItem]}
32+
33+instance Subtree ProcessedPathItems where
34+ type
35+ CheckEnv ProcessedPathItems =
36+ '[ ProdCons (Definitions Param)
37+ , ProdCons (Definitions RequestBody)
38+ , ProdCons (Definitions SecurityScheme)
39+ ]
40+ data CheckIssue ProcessedPathItems = NoPathsMatched | WrongNumberOfFragments
41+ deriving (Eq, Ord, Show)
42+ normalizeTrace = undefined
43+ checkCompatibility env prodCons = do
44+ let ProdCons {producer = p, consumer = c} =
45+ (\paramDefs -> fmap (processPathItem paramDefs) . unProcessedPathItems)
46+ <$> getH @(ProdCons (Definitions Param)) env
47+ <*> prodCons
48+ sequenceA_
49+ [ anyOfAt
50+ producer
51+ NoPathsMatched
52+ [ localTrace (step <$> ProdCons pSPath cSPath) $ do
53+ -- make sure every path fragment is compatible
54+ sequenceA_
55+ [ localTrace (pure . step $ PathFragmentStep i) $
56+ checkCompatibility (singletonH $ ProdCons pPathFragmentParams cPathFragmentParams) pair
57+ | (i, pair) <- zip [0 ..] pathFragments
58+ ]
59+ -- make sure the operation is compatible.
60+ localTrace (pure . step $ getter stepProcessedPathItem) $
61+ checkCompatibility env $ ProdCons pOperation cOperation
62+ pure ()
63+ | (cSPath, cPath, cPathItem) <- c
64+ , -- ... and try to match it with every endpoint in the consumer.
65+ --
66+ -- This is required because the meaning of path fragments can change on
67+ -- a per-method basis even within the same 'PathItem'
68+ --
69+ -- Here we only need to look for the method that the current producer
70+ -- endpoint is using.
71+ (cParams, cOperation) <- maybeToList $ getter cPathItem
72+ , let cPathFragmentParams = retrace (step PathFragmentParentStep >>>) <$> cParams
73+ , -- make sure the paths are the same length
74+ pathFragments <- maybeToList $ zipAllWith ProdCons pPath cPath
75+ ]
76+ | (pSPath, pPath, pPathItem) <- p
77+ , -- look at every endpoint in the producer ...
78+ (ProcessedPathItemGetter getter, (pParams, pOperation)) <-
79+ toList (fmap . (,) <$> processedPathItemGetters <*> pPathItem) >>= maybeToList
80+ , let pPathFragmentParams = retrace (step PathFragmentParentStep >>>) <$> pParams
81+ ]
82+
83+zipAllWith :: (a -> b -> c) -> [a] -> [b] -> Maybe [c]
84+zipAllWith _ [] [] = Just []
85+zipAllWith f (x : xs) (y : ys) = (f x y :) <$> zipAllWith f xs ys
86+zipAllWith _ (_ : _) [] = Nothing
87+zipAllWith _ [] (_ : _) = Nothing
88+
89+processPathItem
90+ :: Definitions Param -- ^ from components
91+ -> ProcessedPathItem
92+ -> ( Step ProcessedPathItems PathItem
93+ , [PathFragment]
94+ , ForeachOperation (Maybe (TracedReferences PathItem Param, Operation))
95+ )
96+processPathItem componentParams ProcessedPathItem {path = pathS, item = pathItem} =
97+ let path = parsePath pathS
98+ commonPathParams =
99+ retrace (step PathItemParametersStep >>>)
100+ <$> getPathParamRefs componentParams (_pathItemParameters pathItem)
101+ processOperation (s :: Step PathItem Operation) op =
102+ let operationParams =
103+ retrace (Root `Snoc` s `Snoc` OperationParamsStep >>>)
104+ <$> getPathParamRefs componentParams (_operationParameters op)
105+ pathParams =
106+ operationParams <> commonPathParams
107+ in (pathParams, op)
108+ in ( PathStep pathS
109+ , path
110+ , fmap . processOperation
111+ <$> stepProcessedPathItem
112+ <*> ForeachOperation
113+ { processedPathItemGet = _pathItemGet pathItem
114+ , processedPathItemPut = _pathItemPut pathItem
115+ , processedPathItemPost = _pathItemPost pathItem
116+ , processedPathItemDelete = _pathItemDelete pathItem
117+ , processedPathItemOptions = _pathItemOptions pathItem
118+ , processedPathItemHead = _pathItemHead pathItem
119+ , processedPathItemPatch = _pathItemPatch pathItem
120+ , processedPathItemTrace = _pathItemTrace pathItem
121+ }
122+ )
123+
124+instance Steppable ProcessedPathItems PathItem where
125+ data Step ProcessedPathItems PathItem = PathStep FilePath
126+ deriving (Eq, Ord, Show)
127+
128+instance Steppable PathItem PathFragment where
129+ data Step PathItem PathFragment
130+ = -- | The index of the path item
131+ PathFragmentStep Int
132+ deriving (Eq, Ord, Show)
133+
134+instance Steppable PathFragment PathItem where
135+ data Step PathFragment PathItem = PathFragmentParentStep
136+ deriving (Eq, Ord, Show)
137+
138+instance Steppable PathItem (Referenced Param) where
139+ data Step PathItem (Referenced Param) = PathItemParametersStep
140+ deriving (Eq, Ord, Show)
141+
142+data ForeachOperation a = ForeachOperation
143+ { processedPathItemGet :: a
144+ , processedPathItemPut :: a
145+ , processedPathItemPost :: a
146+ , processedPathItemDelete :: a
147+ , processedPathItemOptions :: a
148+ , processedPathItemHead :: a
149+ , processedPathItemPatch :: a
150+ , processedPathItemTrace :: a
151+ }
152+ deriving stock (Functor, Generic1)
153+ deriving (Applicative, Foldable) via Generically1 ForeachOperation
154+
155+newtype ProcessedPathItemGetter = ProcessedPathItemGetter (forall a. ForeachOperation a -> a)
156+
157+processedPathItemGetters :: ForeachOperation ProcessedPathItemGetter
158+processedPathItemGetters =
159+ ForeachOperation
160+ { processedPathItemGet = ProcessedPathItemGetter processedPathItemGet
161+ , processedPathItemPut = ProcessedPathItemGetter processedPathItemPut
162+ , processedPathItemPost = ProcessedPathItemGetter processedPathItemPost
163+ , processedPathItemDelete = ProcessedPathItemGetter processedPathItemDelete
164+ , processedPathItemOptions = ProcessedPathItemGetter processedPathItemOptions
165+ , processedPathItemHead = ProcessedPathItemGetter processedPathItemHead
166+ , processedPathItemPatch = ProcessedPathItemGetter processedPathItemPatch
167+ , processedPathItemTrace = ProcessedPathItemGetter processedPathItemTrace
168+ }
169+
170+stepProcessedPathItem :: ForeachOperation (Step PathItem Operation)
171+stepProcessedPathItem =
172+ ForeachOperation
173+ { processedPathItemGet = GetStep
174+ , processedPathItemPut = PutStep
175+ , processedPathItemPost = PostStep
176+ , processedPathItemDelete = DeleteStep
177+ , processedPathItemOptions = OptionsStep
178+ , processedPathItemHead = HeadStep
179+ , processedPathItemPatch = PatchStep
180+ , processedPathItemTrace = TraceStep
181+ }
src/OpenAPI/Checker/Validate/RequestBody.hsnew file+16
@@ -0,0 +1,16 @@
1+{-# OPTIONS_GHC -Wno-orphans #-}
2+
3+module OpenAPI.Checker.Validate.RequestBody
4+ (
5+ )
6+where
7+
8+import Data.OpenApi
9+import OpenAPI.Checker.Subtree
10+
11+instance Subtree RequestBody where
12+ type CheckEnv RequestBody = '[]
13+ data CheckIssue RequestBody
14+ deriving (Eq, Ord, Show)
15+ normalizeTrace = undefined
16+ checkCompatibility = undefined
src/OpenAPI/Checker/Validate/Responses.hsnew file+14
@@ -0,0 +1,14 @@
1+module OpenAPI.Checker.Validate.Responses
2+ (
3+ )
4+where
5+
6+import Data.OpenApi
7+import OpenAPI.Checker.Subtree
8+
9+instance Subtree Responses where
10+ type CheckEnv Responses = '[]
11+ data CheckIssue Responses
12+ deriving (Eq, Ord, Show)
13+ normalizeTrace = undefined
14+ checkCompatibility = undefined
src/OpenAPI/Checker/Validate/SecurityRequirement.hsnew file+19
@@ -0,0 +1,19 @@
1+{-# OPTIONS_GHC -Wno-orphans #-}
2+
3+module OpenAPI.Checker.Validate.SecurityRequirement
4+ (
5+ )
6+where
7+
8+import Data.OpenApi
9+import OpenAPI.Checker.Subtree
10+
11+instance Subtree SecurityRequirement where
12+ type
13+ CheckEnv SecurityRequirement =
14+ '[ ProdCons (Definitions SecurityScheme)
15+ ]
16+ data CheckIssue SecurityRequirement
17+ deriving (Eq, Ord, Show)
18+ normalizeTrace = undefined
19+ checkCompatibility = undefined
src/OpenAPI/Checker/Validate/Server.hsnew file+16
@@ -0,0 +1,16 @@
1+{-# OPTIONS_GHC -Wno-orphans #-}
2+
3+module OpenAPI.Checker.Validate.Server
4+ (
5+ )
6+where
7+
8+import Data.OpenApi
9+import OpenAPI.Checker.Subtree
10+
11+instance Subtree Server where
12+ type CheckEnv Server = '[]
13+ data CheckIssue Server
14+ deriving (Eq, Ord, Show)
15+ normalizeTrace = undefined
16+ checkCompatibility = undefined