Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SwaggerType (t :: SwaggerKind Type) where
- SwaggerString :: forall (t :: SwaggerKind Type). SwaggerType t
- SwaggerNumber :: forall (t :: SwaggerKind Type). SwaggerType t
- SwaggerInteger :: forall (t :: SwaggerKind Type). SwaggerType t
- SwaggerBoolean :: forall (t :: SwaggerKind Type). SwaggerType t
- SwaggerArray :: forall (t :: SwaggerKind Type). SwaggerType t
- SwaggerFile :: SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)
- SwaggerNull :: SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)
- SwaggerObject :: SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)
- type SwaggerToSchema = ToSchema
- type SwaggerToParamSchema = ToParamSchema
- defaultDeclareNamedSchema :: (Typeable a, Applicative f) => (Schema -> Schema) -> proxy a -> f NamedSchema
- nameSchema :: Typeable a => proxy a -> Schema -> NamedSchema
SwaggerType re-export
data SwaggerType (t :: SwaggerKind Type) where #
SwaggerString :: forall (t :: SwaggerKind Type). SwaggerType t | |
SwaggerNumber :: forall (t :: SwaggerKind Type). SwaggerType t | |
SwaggerInteger :: forall (t :: SwaggerKind Type). SwaggerType t | |
SwaggerBoolean :: forall (t :: SwaggerKind Type). SwaggerType t | |
SwaggerArray :: forall (t :: SwaggerKind Type). SwaggerType t | |
SwaggerFile :: SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) | |
SwaggerNull :: SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) | |
SwaggerObject :: SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) |
Instances
Alias types
type SwaggerToSchema = ToSchema Source #
type SwaggerToParamSchema = ToParamSchema Source #
Functions
defaultDeclareNamedSchema :: (Typeable a, Applicative f) => (Schema -> Schema) -> proxy a -> f NamedSchema Source #
This function makes it easy to define a ToSchema
instance. Just
pass in a function that modifies the default empty schema and you're good to
go. For example:
instance ToSchema SomeType where declareNamedSchema = defaultDeclareNamedSchema $ set type_ (Just SwaggerObject) . set title (Just "some type")
nameSchema :: Typeable a => proxy a -> Schema -> NamedSchema Source #
Generates a unique name for the given type and adds that name to the
schema. The generated name will be like ModuleName.TypeName
. For example
it might be Data.Maybe.Maybe
.