Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.OpenApi.Compare.Validate.Products
Description
Checks product-like entities. The key is some identificator for the product element. Each element may be required or optional.
One example of product is request parameters. There are optional and required parameters. The client and server have possibly different set of parameters. What we must check is if server requires some request parameter, then this parameter must be presented by client and their schemas must match.
So when we checking products we are checking from the server's (consumer) perspective, ensuring that all parameters are provided by the client (producer) and their schemas match.
This module abstracts this logic for arbitrary elements
Synopsis
- checkProducts :: (Ord k, Issuable l) => Paths q r l -> (k -> Issue l) -> (k -> ProdCons t -> CompatFormula' q AnIssue r ()) -> ProdCons (Map k (ProductLike t)) -> CompatFormula' q AnIssue r ()
- data ProductLike a = ProductLike {
- productValue :: a
- required :: Bool
Documentation
Arguments
:: (Ord k, Issuable l) | |
=> Paths q r l | |
-> (k -> Issue l) | No required element found |
-> (k -> ProdCons t -> CompatFormula' q AnIssue r ()) | |
-> ProdCons (Map k (ProductLike t)) | |
-> CompatFormula' q AnIssue r () |
data ProductLike a Source #
Some entity which is product-like
Constructors
ProductLike | |
Fields
|