highjson-swagger-0.4.0.0: Derive swagger instances from highjson specs

Safe HaskellNone
LanguageHaskell2010

Data.HighJson.Swagger

Synopsis

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 #

Arguments

:: (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.

type family AllAre x (xs :: [*]) :: Bool where ... Source #

Equations

AllAre x (x ': xs) = AllAre x xs 
AllAre x '[] = True 

type family NoneAre x (xs :: [*]) :: Bool where ... Source #

Equations

NoneAre x (x ': xs) = False 
NoneAre x (y ': xs) = NoneAre x xs 
NoneAre x '[] = True