Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- makeDeclareNamedSchema :: (AllHave ToSchema ts, AllHave ToJSON ts, IsValidSwaggerType ty ts) => HighSpec k ty ts -> f k -> DeclM NamedSchema
- makeDeclareNamedSchema' :: (AllHave ToSchema ts, AllHave ToJSON ts, IsValidSwaggerType ty ts) => HighSpec k ty ts -> Maybe k -> f k -> DeclM NamedSchema
- type DeclM = Declare (Definitions Schema)
- type family IsValidSwaggerType ty (ts :: [*]) :: Constraint where ...
- type family AllAre x (xs :: [*]) :: Bool where ...
- type family NoneAre x (xs :: [*]) :: Bool where ...
Documentation
makeDeclareNamedSchema :: (AllHave ToSchema ts, AllHave ToJSON ts, IsValidSwaggerType ty ts) => HighSpec k ty ts -> f k -> DeclM NamedSchema Source #
Automatically generate a NamedSchema
from a HighSpec
makeDeclareNamedSchema' Source #
:: (AllHave ToSchema ts, AllHave ToJSON ts, IsValidSwaggerType ty ts) | |
=> HighSpec k ty ts | |
-> Maybe k | example value |
-> f k | |
-> DeclM NamedSchema |
Automatically generate a NamedSchema
from a HighSpec
while optionally
providing an example value
type family IsValidSwaggerType ty (ts :: [*]) :: Constraint where ... Source #
Not all valid Haskell types have a valid swagger mapping. Simple records are fine, but sum types should be either "real" Enums or every option must contain a value. For more information see the swagger2 haskell package.
IsValidSwaggerType 'SpecRecord xs = 'True ~ 'True | |
IsValidSwaggerType 'SpecSum xs = NoneAre () xs ~ 'True | |
IsValidSwaggerType 'SpecEnum xs = AllAre () xs ~ 'True |