| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Proto3.Suite.JSONPB
Synopsis
- class FromJSONPB a where
- parseJSONPB :: Value -> Parser a
- class ToJSONPB a where
- (.:) :: (FromJSONPB a, HasDefault a) => Object -> Text -> Parser a
- (.=) :: (HasDefault v, ToJSONPB v, KeyValuePB kvp) => Text -> v -> Options -> kvp
- data Options = Options {}
- defaultOptions :: Options
- jsonPBOptions :: Options
- eitherDecode :: FromJSONPB a => ByteString -> Either String a
- encode :: ToJSONPB a => Options -> a -> ByteString
- enumFieldEncoding :: (Named a, Show a) => a -> Encoding
- enumFieldString :: (Named a, Show a) => a -> Value
- object :: [Options -> [Pair]] -> Options -> Value
- objectOrNull :: [Options -> [Pair]] -> Options -> Value
- pair :: (KeyValuePB m, ToJSONPB v) => Text -> v -> Options -> m
- pairs :: [Options -> Series] -> Options -> Encoding
- pairsOrNull :: [Options -> Series] -> Options -> Encoding
- parseField :: FromJSONPB a => Object -> Key -> Parser a
- toAesonEncoding :: ToJSONPB a => a -> Encoding
- toAesonValue :: ToJSONPB a => a -> Value
- data Value
- class ToJSON a where
- toJSON :: a -> Value
- toEncoding :: a -> Encoding
- toJSONList :: [a] -> Value
- toEncodingList :: [a] -> Encoding
- omitField :: a -> Bool
- class FromJSON a where
- parseJSON :: Value -> Parser a
- parseJSONList :: Value -> Parser [a]
- omittedField :: Maybe a
- typeMismatch :: String -> Value -> Parser a
- withObject :: String -> (Object -> Parser a) -> Value -> Parser a
- class ToSchema a where
- declareNamedSchema :: Proxy a -> Declare (Definitions Schema) NamedSchema
- data NamedSchema = NamedSchema {}
- data Schema = Schema {
- _schemaTitle :: Maybe Text
- _schemaDescription :: Maybe Text
- _schemaRequired :: [ParamName]
- _schemaAllOf :: Maybe [Referenced Schema]
- _schemaProperties :: InsOrdHashMap Text (Referenced Schema)
- _schemaAdditionalProperties :: Maybe AdditionalProperties
- _schemaDiscriminator :: Maybe Text
- _schemaReadOnly :: Maybe Bool
- _schemaXml :: Maybe Xml
- _schemaExternalDocs :: Maybe ExternalDocs
- _schemaExample :: Maybe Value
- _schemaMaxProperties :: Maybe Integer
- _schemaMinProperties :: Maybe Integer
- _schemaParamSchema :: ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)
- data ParamSchema (t :: SwaggerKind Type) = ParamSchema {
- _paramSchemaDefault :: Maybe Value
- _paramSchemaType :: Maybe (SwaggerType t)
- _paramSchemaFormat :: Maybe Format
- _paramSchemaItems :: Maybe (SwaggerItems t)
- _paramSchemaMaximum :: Maybe Scientific
- _paramSchemaExclusiveMaximum :: Maybe Bool
- _paramSchemaMinimum :: Maybe Scientific
- _paramSchemaExclusiveMinimum :: Maybe Bool
- _paramSchemaMaxLength :: Maybe Integer
- _paramSchemaMinLength :: Maybe Integer
- _paramSchemaPattern :: Maybe Pattern
- _paramSchemaMaxItems :: Maybe Integer
- _paramSchemaMinItems :: Maybe Integer
- _paramSchemaUniqueItems :: Maybe Bool
- _paramSchemaEnum :: Maybe [Value]
- _paramSchemaMultipleOf :: Maybe Scientific
- 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)
- declareSchemaRef :: ToSchema a => Proxy a -> Declare (Definitions Schema) (Referenced Schema)
- asProxy :: (Proxy a -> b) -> Proxy a
- insOrdFromList :: (Eq k, Hashable k) => [(k, v)] -> InsOrdHashMap k v
Typeclasses
class FromJSONPB a where Source #
Instances
class ToJSONPB a where Source #
Minimal complete definition
Methods
toJSONPB :: a -> Options -> Value Source #
toJSON variant for JSONPB encoders.
toEncodingPB :: a -> Options -> Encoding Source #
toEncoding variant for JSONPB encoders. If an implementation is not
provided, uses toJSONPB (which is less efficient since it indirects
through the Value IR).
Instances
Operators
(.:) :: (FromJSONPB a, HasDefault a) => Object -> Text -> Parser a Source #
.: variant for JSONPB; if the given key is missing from the
object, or if it is present but its value is null, we produce the default
protobuf value for the field type
(.=) :: (HasDefault v, ToJSONPB v, KeyValuePB kvp) => Text -> v -> Options -> kvp Source #
Options for controlling codec behavior (e.g., emitting default-valued
Constructors
| Options | |
Fields
| |
Instances
defaultOptions :: Options Source #
Default options for JSON encoding. By default, all options are True.
jsonPBOptions :: Options Source #
Options for JSONPB encoding.
JSONPB codec entry points
eitherDecode :: FromJSONPB a => ByteString -> Either String a Source #
eitherDecode variant for deserializing a JSONPB value from a
lazy ByteString.
encode :: ToJSONPB a => Options -> a -> ByteString Source #
encode variant for serializing a JSONPB value as a lazy
ByteString.
Helper functions
parseField :: FromJSONPB a => Object -> Key -> Parser a Source #
toAesonEncoding :: ToJSONPB a => a -> Encoding Source #
A direct Encoding for values which can be JSONPB-encoded.
toAesonValue :: ToJSONPB a => a -> Value Source #
Aeson re-exports
A JSON value represented as a Haskell value.
Instances
| Arbitrary Value | Since: aeson-2.0.3.0 | ||||
| CoArbitrary Value | Since: aeson-2.0.3.0 | ||||
Defined in Data.Aeson.Types.Internal Methods coarbitrary :: Value -> Gen b -> Gen b # | |||||
| Function Value | Since: aeson-2.0.3.0 | ||||
| FromJSON Value | |||||
Defined in Data.Aeson.Types.FromJSON | |||||
| ToJSON Value | |||||
| Data Value | |||||
Defined in Data.Aeson.Types.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Value -> c Value # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Value # dataTypeOf :: Value -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Value) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Value) # gmapT :: (forall b. Data b => b -> b) -> Value -> Value # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r # gmapQ :: (forall d. Data d => d -> u) -> Value -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Value -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Value -> m Value # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value # | |||||
| IsString Value | |||||
Defined in Data.Aeson.Types.Internal Methods fromString :: String -> Value # | |||||
| Generic Value | |||||
Defined in Data.Aeson.Types.Internal Associated Types
| |||||
| Read Value | |||||
| Show Value | Since version 1.5.6.0 version object values are printed in lexicographic key order
| ||||
| NFData Value | |||||
Defined in Data.Aeson.Types.Internal | |||||
| Eq Value | |||||
| Ord Value | The ordering is total, consistent with Since: aeson-1.5.2.0 | ||||
| Hashable Value | |||||
Defined in Data.Aeson.Types.Internal | |||||
| HasDefault Encoding Source # |
| ||||
| HasDefault Value Source # |
| ||||
| FromJSONPB Value Source # | |||||
Defined in Proto3.Suite.JSONPB.Class | |||||
| ToJSONPB Encoding Source # | |||||
| ToJSONPB Value Source # | |||||
| ToSchema Object | |||||
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Object -> Declare (Definitions Schema) NamedSchema # | |||||
| KeyValue Encoding Series | |||||
| KeyValueOmit Encoding Series | |||||
| Lift Value | Since: aeson-0.11.0.0 | ||||
| (GToJSON' Encoding arity a, ConsToJSON Encoding arity a, Constructor c) => SumToJSON' TwoElemArray Encoding arity (C1 c a) | |||||
Defined in Data.Aeson.Types.ToJSON | |||||
| (GToJSON' Value arity a, ConsToJSON Value arity a, Constructor c) => SumToJSON' TwoElemArray Value arity (C1 c a) | |||||
Defined in Data.Aeson.Types.ToJSON | |||||
| GToJSON' Encoding arity (U1 :: Type -> Type) | |||||
| GToJSON' Encoding arity (V1 :: Type -> Type) | |||||
| GToJSON' Value arity (U1 :: Type -> Type) | |||||
| GToJSON' Value arity (V1 :: Type -> Type) | |||||
| ToJSON1 f => GToJSON' Encoding One (Rec1 f) | |||||
| ToJSON1 f => GToJSON' Value One (Rec1 f) | |||||
| (EncodeProduct arity a, EncodeProduct arity b) => GToJSON' Encoding arity (a :*: b) | |||||
| ToJSON a => GToJSON' Encoding arity (K1 i a :: Type -> Type) | |||||
| (WriteProduct arity a, WriteProduct arity b, ProductSize a, ProductSize b) => GToJSON' Value arity (a :*: b) | |||||
| ToJSON a => GToJSON' Value arity (K1 i a :: Type -> Type) | |||||
| (ToJSON1 f, GToJSON' Encoding One g) => GToJSON' Encoding One (f :.: g) | |||||
| (ToJSON1 f, GToJSON' Value One g) => GToJSON' Value One (f :.: g) | |||||
| FromPairs Value (DList Pair) | |||||
Defined in Data.Aeson.Types.ToJSON | |||||
| value ~ Value => KeyValue Value (KeyMap value) | Constructs a singleton | ||||
| value ~ Value => KeyValueOmit Value (KeyMap value) | |||||
| v ~ Value => KeyValuePair v (DList Pair) | |||||
Defined in Data.Aeson.Types.ToJSON | |||||
| HasDefault Header (Maybe Value) | |||||
| HasDefault ParamOtherSchema (Maybe Value) | |||||
Defined in Data.Swagger.Lens | |||||
| HasDefault Schema (Maybe Value) | |||||
| HasParamSchema s (ParamSchema t) => HasEnum s (Maybe [Value]) | |||||
| HasExample Schema (Maybe Value) | |||||
| (key ~ Key, value ~ Value) => KeyValue Value (key, value) | |||||
Defined in Data.Aeson.Types.ToJSON | |||||
| HasExtensions Operation (InsOrdHashMap Text Value) | |||||
Defined in Data.Swagger.Lens Methods | |||||
| KeyValuePB [Pair] Source # | |||||
| HasDefault (ParamSchema t) (Maybe Value) | |||||
Defined in Data.Swagger.Lens | |||||
| HasEnum (ParamSchema t) (Maybe [Value]) | |||||
Defined in Data.Swagger.Lens | |||||
| type Rep Value | |||||
Defined in Data.Aeson.Types.Internal type Rep Value = D1 ('MetaData "Value" "Data.Aeson.Types.Internal" "aeson-2.2.3.0-LUFJ19QWNo23HUZavAYqkm" 'False) ((C1 ('MetaCons "Object" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Object)) :+: (C1 ('MetaCons "Array" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Array)) :+: C1 ('MetaCons "String" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))) :+: (C1 ('MetaCons "Number" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Scientific)) :+: (C1 ('MetaCons "Bool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :+: C1 ('MetaCons "Null" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||
A type that can be converted to JSON.
Instances in general must specify toJSON and should (but don't need
to) specify toEncoding.
An example type and instance:
-- Allow ourselves to writeTextliterals. {-# LANGUAGE OverloadedStrings #-} data Coord = Coord { x :: Double, y :: Double } instanceToJSONCoord wheretoJSON(Coord x y) =object["x".=x, "y".=y]toEncoding(Coord x y) =pairs("x".=x<>"y".=y)
Instead of manually writing your ToJSON instance, there are two options
to do it automatically:
- Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so it will probably be more efficient than the following option.
- The compiler can provide a default generic implementation for
toJSON.
To use the second, simply add a deriving clause to your
datatype and declare a GenericToJSON instance. If you require nothing other than
defaultOptions, it is sufficient to write (and this is the only
alternative where the default toJSON implementation is sufficient):
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics
data Coord = Coord { x :: Double, y :: Double } deriving Generic
instance ToJSON Coord where
toEncoding = genericToEncoding defaultOptions
or more conveniently using the DerivingVia extension
deriving viaGenericallyCoord instanceToJSONCoord
If on the other hand you wish to customize the generic decoding, you have to implement both methods:
customOptions =defaultOptions{fieldLabelModifier=maptoUpper} instanceToJSONCoord wheretoJSON=genericToJSONcustomOptionstoEncoding=genericToEncodingcustomOptions
Previous versions of this library only had the toJSON method. Adding
toEncoding had two reasons:
toEncodingis more efficient for the common case that the output oftoJSONis directly serialized to aByteString. Further, expressing either method in terms of the other would be non-optimal.- The choice of defaults allows a smooth transition for existing users:
Existing instances that do not define
toEncodingstill compile and have the correct semantics. This is ensured by making the default implementation oftoEncodingusetoJSON. This produces correct results, but since it performs an intermediate conversion to aValue, it will be less efficient than directly emitting anEncoding. (this also means that specifying nothing more thaninstance ToJSON Coordwould be sufficient as a generically decoding instance, but there probably exists no good reason to not specifytoEncodingin new instances.)
Minimal complete definition
Nothing
Methods
Convert a Haskell value to a JSON-friendly intermediate type.
toEncoding :: a -> Encoding #
Encode a Haskell value as JSON.
The default implementation of this method creates an
intermediate Value using toJSON. This provides
source-level compatibility for people upgrading from older
versions of this library, but obviously offers no performance
advantage.
To benefit from direct encoding, you must provide an
implementation for this method. The easiest way to do so is by
having your types implement Generic using the DeriveGeneric
extension, and then have GHC generate a method body as follows.
instanceToJSONCoord wheretoEncoding=genericToEncodingdefaultOptions
toJSONList :: [a] -> Value #
toEncodingList :: [a] -> Encoding #
Defines when it is acceptable to omit a field of this type from a record.
Used by ( operator, and Generics and TH deriving
with .?=).omitNothingFields = True
Since: aeson-2.2.0.0
Instances
| ToJSON Key | |
| ToJSON DotNetTime | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: DotNetTime -> Value # toEncoding :: DotNetTime -> Encoding # toJSONList :: [DotNetTime] -> Value # toEncodingList :: [DotNetTime] -> Encoding # omitField :: DotNetTime -> Bool # | |
| ToJSON Value | |
| ToJSON All | Since: aeson-2.2.3.0 |
| ToJSON Any | Since: aeson-2.2.3.0 |
| ToJSON Version | |
| ToJSON CTime | |
| ToJSON Void | |
| ToJSON Int16 | |
| ToJSON Int32 | |
| ToJSON Int64 | |
| ToJSON Int8 | |
| ToJSON Word16 | |
| ToJSON Word32 | |
| ToJSON Word64 | |
| ToJSON Word8 | |
| ToJSON IntSet | |
| ToJSON Ordering | |
| ToJSON URI | Since: aeson-2.2.0.0 |
| ToJSON Timestamp Source # | |
| ToJSON Scientific | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Scientific -> Value # toEncoding :: Scientific -> Encoding # toJSONList :: [Scientific] -> Value # toEncodingList :: [Scientific] -> Encoding # omitField :: Scientific -> Bool # | |
| ToJSON AdditionalProperties | |
Defined in Data.Swagger.Internal Methods toJSON :: AdditionalProperties -> Value # toEncoding :: AdditionalProperties -> Encoding # toJSONList :: [AdditionalProperties] -> Value # toEncodingList :: [AdditionalProperties] -> Encoding # omitField :: AdditionalProperties -> Bool # | |
| ToJSON ApiKeyLocation | |
Defined in Data.Swagger.Internal Methods toJSON :: ApiKeyLocation -> Value # toEncoding :: ApiKeyLocation -> Encoding # toJSONList :: [ApiKeyLocation] -> Value # toEncodingList :: [ApiKeyLocation] -> Encoding # omitField :: ApiKeyLocation -> Bool # | |
| ToJSON ApiKeyParams | |
Defined in Data.Swagger.Internal Methods toJSON :: ApiKeyParams -> Value # toEncoding :: ApiKeyParams -> Encoding # toJSONList :: [ApiKeyParams] -> Value # toEncodingList :: [ApiKeyParams] -> Encoding # omitField :: ApiKeyParams -> Bool # | |
| ToJSON Contact | |
| ToJSON Example | |
| ToJSON ExternalDocs | |
Defined in Data.Swagger.Internal Methods toJSON :: ExternalDocs -> Value # toEncoding :: ExternalDocs -> Encoding # toJSONList :: [ExternalDocs] -> Value # toEncodingList :: [ExternalDocs] -> Encoding # omitField :: ExternalDocs -> Bool # | |
| ToJSON Header | |
| ToJSON Host | |
| ToJSON Info | |
| ToJSON License | |
| ToJSON MimeList | |
| ToJSON OAuth2Flow | |
Defined in Data.Swagger.Internal Methods toJSON :: OAuth2Flow -> Value # toEncoding :: OAuth2Flow -> Encoding # toJSONList :: [OAuth2Flow] -> Value # toEncodingList :: [OAuth2Flow] -> Encoding # omitField :: OAuth2Flow -> Bool # | |
| ToJSON OAuth2Params | |
Defined in Data.Swagger.Internal Methods toJSON :: OAuth2Params -> Value # toEncoding :: OAuth2Params -> Encoding # toJSONList :: [OAuth2Params] -> Value # toEncodingList :: [OAuth2Params] -> Encoding # omitField :: OAuth2Params -> Bool # | |
| ToJSON Operation | |
| ToJSON Param | |
| ToJSON ParamAnySchema | |
Defined in Data.Swagger.Internal Methods toJSON :: ParamAnySchema -> Value # toEncoding :: ParamAnySchema -> Encoding # toJSONList :: [ParamAnySchema] -> Value # toEncodingList :: [ParamAnySchema] -> Encoding # omitField :: ParamAnySchema -> Bool # | |
| ToJSON ParamLocation | |
Defined in Data.Swagger.Internal Methods toJSON :: ParamLocation -> Value # toEncoding :: ParamLocation -> Encoding # toJSONList :: [ParamLocation] -> Value # toEncodingList :: [ParamLocation] -> Encoding # omitField :: ParamLocation -> Bool # | |
| ToJSON ParamOtherSchema | |
Defined in Data.Swagger.Internal Methods toJSON :: ParamOtherSchema -> Value # toEncoding :: ParamOtherSchema -> Encoding # toJSONList :: [ParamOtherSchema] -> Value # toEncodingList :: [ParamOtherSchema] -> Encoding # omitField :: ParamOtherSchema -> Bool # | |
| ToJSON PathItem | |
| ToJSON Reference | |
| ToJSON Response | |
| ToJSON Responses | |
| ToJSON Schema | |
| ToJSON Scheme | |
| ToJSON SecurityDefinitions | |
Defined in Data.Swagger.Internal Methods toJSON :: SecurityDefinitions -> Value # toEncoding :: SecurityDefinitions -> Encoding # toJSONList :: [SecurityDefinitions] -> Value # toEncodingList :: [SecurityDefinitions] -> Encoding # omitField :: SecurityDefinitions -> Bool # | |
| ToJSON SecurityRequirement | |
Defined in Data.Swagger.Internal Methods toJSON :: SecurityRequirement -> Value # toEncoding :: SecurityRequirement -> Encoding # toJSONList :: [SecurityRequirement] -> Value # toEncodingList :: [SecurityRequirement] -> Encoding # omitField :: SecurityRequirement -> Bool # | |
| ToJSON SecurityScheme | |
Defined in Data.Swagger.Internal Methods toJSON :: SecurityScheme -> Value # toEncoding :: SecurityScheme -> Encoding # toJSONList :: [SecurityScheme] -> Value # toEncodingList :: [SecurityScheme] -> Encoding # omitField :: SecurityScheme -> Bool # | |
| ToJSON SecuritySchemeType | |
Defined in Data.Swagger.Internal Methods toJSON :: SecuritySchemeType -> Value # toEncoding :: SecuritySchemeType -> Encoding # toJSONList :: [SecuritySchemeType] -> Value # toEncodingList :: [SecuritySchemeType] -> Encoding # omitField :: SecuritySchemeType -> Bool # | |
| ToJSON Swagger | |
| ToJSON Tag | |
| ToJSON URL | |
| ToJSON Xml | |
| ToJSON Text | |
| ToJSON Text | |
| ToJSON ShortText | Since: aeson-2.0.2.0 |
| ToJSON CalendarDiffDays | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: CalendarDiffDays -> Value # toEncoding :: CalendarDiffDays -> Encoding # toJSONList :: [CalendarDiffDays] -> Value # toEncodingList :: [CalendarDiffDays] -> Encoding # omitField :: CalendarDiffDays -> Bool # | |
| ToJSON Day | |
| ToJSON Month | |
| ToJSON Quarter | |
| ToJSON QuarterOfYear | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: QuarterOfYear -> Value # toEncoding :: QuarterOfYear -> Encoding # toJSONList :: [QuarterOfYear] -> Value # toEncodingList :: [QuarterOfYear] -> Encoding # omitField :: QuarterOfYear -> Bool # | |
| ToJSON DayOfWeek | |
| ToJSON DiffTime | |
| ToJSON NominalDiffTime | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: NominalDiffTime -> Value # toEncoding :: NominalDiffTime -> Encoding # toJSONList :: [NominalDiffTime] -> Value # toEncodingList :: [NominalDiffTime] -> Encoding # omitField :: NominalDiffTime -> Bool # | |
| ToJSON SystemTime | Encoded as number |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: SystemTime -> Value # toEncoding :: SystemTime -> Encoding # toJSONList :: [SystemTime] -> Value # toEncodingList :: [SystemTime] -> Encoding # omitField :: SystemTime -> Bool # | |
| ToJSON UTCTime | |
| ToJSON CalendarDiffTime | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: CalendarDiffTime -> Value # toEncoding :: CalendarDiffTime -> Encoding # toJSONList :: [CalendarDiffTime] -> Value # toEncodingList :: [CalendarDiffTime] -> Encoding # omitField :: CalendarDiffTime -> Bool # | |
| ToJSON LocalTime | |
| ToJSON TimeOfDay | |
| ToJSON ZonedTime | |
| ToJSON UUID | |
| ToJSON Integer | |
| ToJSON Natural | |
| ToJSON () | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: () -> Encoding # toJSONList :: [()] -> Value # toEncodingList :: [()] -> Encoding # | |
| ToJSON Bool | |
| ToJSON Char | |
| ToJSON Double | |
| ToJSON Float | |
| ToJSON Int | |
| ToJSON Word | |
| ToJSON v => ToJSON (KeyMap v) | |
| ToJSON a => ToJSON (Identity a) | |
| ToJSON a => ToJSON (First a) | |
| ToJSON a => ToJSON (Last a) | |
| ToJSON a => ToJSON (Down a) | Since: aeson-2.2.0.0 |
| ToJSON a => ToJSON (First a) | |
| ToJSON a => ToJSON (Last a) | |
| ToJSON a => ToJSON (Max a) | |
| ToJSON a => ToJSON (Min a) | |
| ToJSON a => ToJSON (WrappedMonoid a) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: WrappedMonoid a -> Value # toEncoding :: WrappedMonoid a -> Encoding # toJSONList :: [WrappedMonoid a] -> Value # toEncodingList :: [WrappedMonoid a] -> Encoding # omitField :: WrappedMonoid a -> Bool # | |
| ToJSON a => ToJSON (Dual a) | |
| ToJSON a => ToJSON (Product a) | Since: aeson-2.2.3.0 |
| ToJSON a => ToJSON (Sum a) | Since: aeson-2.2.3.0 |
| ToJSON a => ToJSON (NonEmpty a) | |
| (Generic a, GToJSON' Value Zero (Rep a), GToJSON' Encoding Zero (Rep a)) => ToJSON (Generically a) | Since: aeson-2.1.0.0 |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Generically a -> Value # toEncoding :: Generically a -> Encoding # toJSONList :: [Generically a] -> Value # toEncodingList :: [Generically a] -> Encoding # omitField :: Generically a -> Bool # | |
| (ToJSON a, Integral a) => ToJSON (Ratio a) | |
| ToJSON a => ToJSON (IntMap a) | |
| ToJSON a => ToJSON (Seq a) | |
| ToJSON a => ToJSON (Set a) | |
| ToJSON v => ToJSON (Tree v) | |
| ToJSON1 f => ToJSON (Fix f) | Since: aeson-1.5.3.0 |
| (ToJSON1 f, Functor f) => ToJSON (Mu f) | Since: aeson-1.5.3.0 |
| (ToJSON1 f, Functor f) => ToJSON (Nu f) | Since: aeson-1.5.3.0 |
| ToJSON a => ToJSON (DNonEmpty a) | Since: aeson-1.5.3.0 |
| ToJSON a => ToJSON (DList a) | |
| ToJSON a => ToJSON (InsOrdHashSet a) | |
Defined in Data.HashSet.InsOrd Methods toJSON :: InsOrdHashSet a -> Value # toEncoding :: InsOrdHashSet a -> Encoding # toJSONList :: [InsOrdHashSet a] -> Value # toEncodingList :: [InsOrdHashSet a] -> Encoding # omitField :: InsOrdHashSet a -> Bool # | |
| ToJSON a => ToJSON (Array a) | |
| (Prim a, ToJSON a) => ToJSON (PrimArray a) | |
| ToJSON a => ToJSON (SmallArray a) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: SmallArray a -> Value # toEncoding :: SmallArray a -> Encoding # toJSONList :: [SmallArray a] -> Value # toEncodingList :: [SmallArray a] -> Encoding # omitField :: SmallArray a -> Bool # | |
| ToJSON a => ToJSON (Wrapped a) Source # | |
| (Message message, ToJSONPB message) => ToJSON (MessageEncoding message) Source # | |
Defined in Proto3.Suite.Form.Encode Methods toJSON :: MessageEncoding message -> Value # toEncoding :: MessageEncoding message -> Encoding # toJSONList :: [MessageEncoding message] -> Value # toEncodingList :: [MessageEncoding message] -> Encoding # omitField :: MessageEncoding message -> Bool # | |
| (Message message, ToJSONPB message) => ToJSON (MessageEncoder message) Source # | |
Defined in Proto3.Suite.Form.Encode Methods toJSON :: MessageEncoder message -> Value # toEncoding :: MessageEncoder message -> Encoding # toJSONList :: [MessageEncoder message] -> Value # toEncodingList :: [MessageEncoder message] -> Encoding # omitField :: MessageEncoder message -> Bool # | |
| ToJSON a => ToJSON (Maybe a) | Since: aeson-1.5.3.0 |
| ToJSON (CollectionFormat t) | |
Defined in Data.Swagger.Internal Methods toJSON :: CollectionFormat t -> Value # toEncoding :: CollectionFormat t -> Encoding # toJSONList :: [CollectionFormat t] -> Value # toEncodingList :: [CollectionFormat t] -> Encoding # omitField :: CollectionFormat t -> Bool # | |
| ToJSON (ParamSchema k) | |
Defined in Data.Swagger.Internal Methods toJSON :: ParamSchema k -> Value # toEncoding :: ParamSchema k -> Encoding # toJSONList :: [ParamSchema k] -> Value # toEncodingList :: [ParamSchema k] -> Encoding # omitField :: ParamSchema k -> Bool # | |
| ToJSON (Referenced Param) | |
Defined in Data.Swagger.Internal Methods toJSON :: Referenced Param -> Value # toEncoding :: Referenced Param -> Encoding # toJSONList :: [Referenced Param] -> Value # toEncodingList :: [Referenced Param] -> Encoding # omitField :: Referenced Param -> Bool # | |
| ToJSON (Referenced Response) | |
Defined in Data.Swagger.Internal Methods toJSON :: Referenced Response -> Value # toEncoding :: Referenced Response -> Encoding # toJSONList :: [Referenced Response] -> Value # toEncodingList :: [Referenced Response] -> Encoding # omitField :: Referenced Response -> Bool # | |
| ToJSON (Referenced Schema) | |
Defined in Data.Swagger.Internal Methods toJSON :: Referenced Schema -> Value # toEncoding :: Referenced Schema -> Encoding # toJSONList :: [Referenced Schema] -> Value # toEncodingList :: [Referenced Schema] -> Encoding # omitField :: Referenced Schema -> Bool # | |
| ToJSON (ParamSchema t) => ToJSON (SwaggerItems t) | As for nullary schema for 0-arity type constructors, see https://github.com/GetShopTV/swagger2/issues/167.
|
Defined in Data.Swagger.Internal Methods toJSON :: SwaggerItems t -> Value # toEncoding :: SwaggerItems t -> Encoding # toJSONList :: [SwaggerItems t] -> Value # toEncodingList :: [SwaggerItems t] -> Encoding # omitField :: SwaggerItems t -> Bool # | |
| ToJSON (SwaggerType t) | |
Defined in Data.Swagger.Internal Methods toJSON :: SwaggerType t -> Value # toEncoding :: SwaggerType t -> Encoding # toJSONList :: [SwaggerType t] -> Value # toEncodingList :: [SwaggerType t] -> Encoding # omitField :: SwaggerType t -> Bool # | |
| ToJSON a => ToJSON (HashSet a) | |
| ToJSON a => ToJSON (Vector a) | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: Vector a -> Encoding # toJSONList :: [Vector a] -> Value # toEncodingList :: [Vector a] -> Encoding # | |
| (Prim a, ToJSON a) => ToJSON (Vector a) | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: Vector a -> Encoding # toJSONList :: [Vector a] -> Value # toEncodingList :: [Vector a] -> Encoding # | |
| (Storable a, ToJSON a) => ToJSON (Vector a) | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: Vector a -> Encoding # toJSONList :: [Vector a] -> Value # toEncodingList :: [Vector a] -> Encoding # | |
| (Vector Vector a, ToJSON a) => ToJSON (Vector a) | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: Vector a -> Encoding # toJSONList :: [Vector a] -> Value # toEncodingList :: [Vector a] -> Encoding # | |
| ToJSON a => ToJSON (Maybe a) | |
| ToJSON a => ToJSON (Solo a) | Since: aeson-2.0.2.0 |
| ToJSON a => ToJSON [a] | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: [a] -> Encoding # toJSONList :: [[a]] -> Value # toEncodingList :: [[a]] -> Encoding # | |
| (ToJSON a, ToJSON b) => ToJSON (Either a b) | |
| HasResolution a => ToJSON (Fixed a) | |
| ToJSON (Proxy a) | |
| (ToJSON v, ToJSONKey k) => ToJSON (Map k v) | |
| (ToJSONKey k, ToJSON v) => ToJSON (InsOrdHashMap k v) | |
Defined in Data.HashMap.Strict.InsOrd Methods toJSON :: InsOrdHashMap k v -> Value # toEncoding :: InsOrdHashMap k v -> Encoding # toJSONList :: [InsOrdHashMap k v] -> Value # toEncodingList :: [InsOrdHashMap k v] -> Encoding # omitField :: InsOrdHashMap k v -> Bool # | |
| (ToJSON a, ToJSON b) => ToJSON (Either a b) | Since: aeson-1.5.3.0 |
| (ToJSON a, ToJSON b) => ToJSON (These a b) | Since: aeson-1.5.3.0 |
| (ToJSON a, ToJSON b) => ToJSON (Pair a b) | Since: aeson-1.5.3.0 |
| (ToJSON a, ToJSON b) => ToJSON (These a b) | Since: aeson-1.5.1.0 |
| (ToJSON v, ToJSONKey k) => ToJSON (HashMap k v) | |
| (ToJSON a, ToJSON b) => ToJSON (a, b) | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: (a, b) -> Encoding # toJSONList :: [(a, b)] -> Value # toEncodingList :: [(a, b)] -> Encoding # | |
| ToJSON a => ToJSON (Const a b) | |
| ToJSON b => ToJSON (Tagged a b) | |
| (ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (These1 f g a) | Since: aeson-1.5.1.0 |
| (ToJSON a, ToJSON b, ToJSON c) => ToJSON (a, b, c) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c) -> Value # toEncoding :: (a, b, c) -> Encoding # toJSONList :: [(a, b, c)] -> Value # toEncodingList :: [(a, b, c)] -> Encoding # | |
| (ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Product f g a) | |
| (ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Sum f g a) | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON (a, b, c, d) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d) -> Value # toEncoding :: (a, b, c, d) -> Encoding # toJSONList :: [(a, b, c, d)] -> Value # toEncodingList :: [(a, b, c, d)] -> Encoding # | |
| (ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Compose f g a) | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON (a, b, c, d, e) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e) -> Value # toEncoding :: (a, b, c, d, e) -> Encoding # toJSONList :: [(a, b, c, d, e)] -> Value # toEncodingList :: [(a, b, c, d, e)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON (a, b, c, d, e, f) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f) -> Value # toEncoding :: (a, b, c, d, e, f) -> Encoding # toJSONList :: [(a, b, c, d, e, f)] -> Value # toEncodingList :: [(a, b, c, d, e, f)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g) => ToJSON (a, b, c, d, e, f, g) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g) -> Value # toEncoding :: (a, b, c, d, e, f, g) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h) => ToJSON (a, b, c, d, e, f, g, h) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h) -> Value # toEncoding :: (a, b, c, d, e, f, g, h) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i) => ToJSON (a, b, c, d, e, f, g, h, i) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h, i) -> Value # toEncoding :: (a, b, c, d, e, f, g, h, i) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h, i)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h, i)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j) => ToJSON (a, b, c, d, e, f, g, h, i, j) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h, i, j) -> Value # toEncoding :: (a, b, c, d, e, f, g, h, i, j) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h, i, j)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h, i, j)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k) => ToJSON (a, b, c, d, e, f, g, h, i, j, k) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h, i, j, k) -> Value # toEncoding :: (a, b, c, d, e, f, g, h, i, j, k) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Value # toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> Encoding # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Value # toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> Encoding # omitField :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Value # toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> Encoding # omitField :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # | |
| (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n, ToJSON o) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
Defined in Data.Aeson.Types.ToJSON Methods toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Value # toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Encoding # toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> Value # toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> Encoding # omitField :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # | |
A type that can be converted from JSON, with the possibility of failure.
In many cases, you can get the compiler to generate parsing code for you (see below). To begin, let's cover writing an instance by hand.
There are various reasons a conversion could fail. For example, an
Object could be missing a required key, an Array could be of
the wrong size, or a value could be of an incompatible type.
The basic ways to signal a failed conversion are as follows:
failyields a custom error message: it is the recommended way of reporting a failure;empty(ormzero) is uninformative: use it when the error is meant to be caught by some(;<|>)typeMismatchcan be used to report a failure when the encountered value is not of the expected JSON type;unexpectedis an appropriate alternative when more than one type may be expected, or to keep the expected type implicit.
prependFailure (or modifyFailure) add more information to a parser's
error messages.
An example type and instance using typeMismatch and prependFailure:
-- Allow ourselves to writeTextliterals. {-# LANGUAGE OverloadedStrings #-} data Coord = Coord { x :: Double, y :: Double } instanceFromJSONCoord whereparseJSON(Objectv) = Coord<$>v.:"x"<*>v.:"y" -- We do not expect a non-Objectvalue here. -- We could useemptyto fail, buttypeMismatch-- gives a much more informative error message.parseJSONinvalid =prependFailure"parsing Coord failed, " (typeMismatch"Object" invalid)
For this common case of only being concerned with a single
type of JSON value, the functions withObject, withScientific, etc.
are provided. Their use is to be preferred when possible, since
they are more terse. Using withObject, we can rewrite the above instance
(assuming the same language extension and data type) as:
instanceFromJSONCoord whereparseJSON=withObject"Coord" $ \v -> Coord<$>v.:"x"<*>v.:"y"
Instead of manually writing your FromJSON instance, there are two options
to do it automatically:
- Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so it will probably be more efficient than the following option.
- The compiler can provide a default generic implementation for
parseJSON.
To use the second, simply add a deriving clause to your
datatype and declare a GenericFromJSON instance for your datatype without giving
a definition for parseJSON.
For example, the previous example can be simplified to just:
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics
data Coord = Coord { x :: Double, y :: Double } deriving Generic
instance FromJSON Coord
or using the DerivingVia extension
deriving viaGenericallyCoord instanceFromJSONCoord
The default implementation will be equivalent to
parseJSON = ; if you need different
options, you can customize the generic decoding by defining:genericParseJSON defaultOptions
customOptions =defaultOptions{fieldLabelModifier=maptoUpper} instanceFromJSONCoord whereparseJSON=genericParseJSONcustomOptions
Minimal complete definition
Nothing
Methods
parseJSON :: Value -> Parser a #
parseJSONList :: Value -> Parser [a] #
omittedField :: Maybe a #
Default value for optional fields.
Used by ( operator, and Generics and TH deriving
with .:?=) (default).allowOmittedFields = True
Since: aeson-2.2.0.0
Instances
| FromJSON Key | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON DotNetTime | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Value | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON All | Since: aeson-2.2.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Any | Since: aeson-2.2.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Version | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON CTime | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Void | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Int16 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Int32 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Int64 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Int8 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Word16 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Word32 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Word64 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Word8 | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON IntSet | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Ordering | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON URI | Since: aeson-2.2.0.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Timestamp Source # | |
Defined in Google.Protobuf.Timestamp | |
| FromJSON Scientific | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON AdditionalProperties | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser AdditionalProperties # parseJSONList :: Value -> Parser [AdditionalProperties] # | |
| FromJSON ApiKeyLocation | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser ApiKeyLocation # parseJSONList :: Value -> Parser [ApiKeyLocation] # | |
| FromJSON ApiKeyParams | |
Defined in Data.Swagger.Internal | |
| FromJSON Contact | |
Defined in Data.Swagger.Internal | |
| FromJSON Example | |
Defined in Data.Swagger.Internal | |
| FromJSON ExternalDocs | |
Defined in Data.Swagger.Internal | |
| FromJSON Header | |
Defined in Data.Swagger.Internal | |
| FromJSON Host | |
Defined in Data.Swagger.Internal | |
| FromJSON Info | |
Defined in Data.Swagger.Internal | |
| FromJSON License | |
Defined in Data.Swagger.Internal | |
| FromJSON MimeList | |
Defined in Data.Swagger.Internal | |
| FromJSON OAuth2Flow | |
Defined in Data.Swagger.Internal | |
| FromJSON OAuth2Params | |
Defined in Data.Swagger.Internal | |
| FromJSON Operation | |
Defined in Data.Swagger.Internal | |
| FromJSON Param | |
Defined in Data.Swagger.Internal | |
| FromJSON ParamAnySchema | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser ParamAnySchema # parseJSONList :: Value -> Parser [ParamAnySchema] # | |
| FromJSON ParamLocation | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser ParamLocation # parseJSONList :: Value -> Parser [ParamLocation] # | |
| FromJSON ParamOtherSchema | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser ParamOtherSchema # parseJSONList :: Value -> Parser [ParamOtherSchema] # | |
| FromJSON PathItem | |
Defined in Data.Swagger.Internal | |
| FromJSON Reference | |
Defined in Data.Swagger.Internal | |
| FromJSON Response | |
Defined in Data.Swagger.Internal | |
| FromJSON Responses | |
Defined in Data.Swagger.Internal | |
| FromJSON Schema | |
Defined in Data.Swagger.Internal | |
| FromJSON Scheme | |
Defined in Data.Swagger.Internal | |
| FromJSON SecurityDefinitions | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser SecurityDefinitions # parseJSONList :: Value -> Parser [SecurityDefinitions] # | |
| FromJSON SecurityRequirement | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser SecurityRequirement # parseJSONList :: Value -> Parser [SecurityRequirement] # | |
| FromJSON SecurityScheme | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser SecurityScheme # parseJSONList :: Value -> Parser [SecurityScheme] # | |
| FromJSON SecuritySchemeType | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser SecuritySchemeType # parseJSONList :: Value -> Parser [SecuritySchemeType] # | |
| FromJSON Swagger | |
Defined in Data.Swagger.Internal | |
| FromJSON Tag | |
Defined in Data.Swagger.Internal | |
| FromJSON URL | |
Defined in Data.Swagger.Internal | |
| FromJSON Xml | |
Defined in Data.Swagger.Internal | |
| FromJSON Text | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Text | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON ShortText | Since: aeson-2.0.2.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON CalendarDiffDays | |
Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser CalendarDiffDays # parseJSONList :: Value -> Parser [CalendarDiffDays] # | |
| FromJSON Day | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Month | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Quarter | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON QuarterOfYear | |
Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser QuarterOfYear # parseJSONList :: Value -> Parser [QuarterOfYear] # | |
| FromJSON DayOfWeek | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON DiffTime | This instance includes a bounds check to prevent maliciously
large inputs to fill up the memory of the target system. You can
newtype |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON NominalDiffTime | This instance includes a bounds check to prevent maliciously
large inputs to fill up the memory of the target system. You can
newtype |
Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser NominalDiffTime # parseJSONList :: Value -> Parser [NominalDiffTime] # | |
| FromJSON SystemTime | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON UTCTime | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON CalendarDiffTime | |
Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser CalendarDiffTime # parseJSONList :: Value -> Parser [CalendarDiffTime] # | |
| FromJSON LocalTime | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON TimeOfDay | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON ZonedTime | Supported string formats:
The first space may instead be a |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON UUID | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Integer | This instance includes a bounds check to prevent maliciously
large inputs to fill up the memory of the target system. You can
newtype |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Natural | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON () | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Bool | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Char | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Double | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Float | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Int | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON Word | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON v => FromJSON (KeyMap v) | Since: aeson-2.0.1.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Identity a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (First a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Last a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Down a) | Since: aeson-2.2.0.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (First a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Last a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Max a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Min a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (WrappedMonoid a) | |
Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser (WrappedMonoid a) # parseJSONList :: Value -> Parser [WrappedMonoid a] # omittedField :: Maybe (WrappedMonoid a) # | |
| FromJSON a => FromJSON (Dual a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Product a) | Since: aeson-2.2.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Sum a) | Since: aeson-2.2.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (NonEmpty a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Generic a, GFromJSON Zero (Rep a)) => FromJSON (Generically a) | Since: aeson-2.1.0.0 |
Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser (Generically a) # parseJSONList :: Value -> Parser [Generically a] # omittedField :: Maybe (Generically a) # | |
| (FromJSON a, Integral a) => FromJSON (Ratio a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (IntMap a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Seq a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Ord a, FromJSON a) => FromJSON (Set a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON v => FromJSON (Tree v) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON1 f => FromJSON (Fix f) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON1 f, Functor f) => FromJSON (Mu f) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON1 f, Functor f) => FromJSON (Nu f) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (DNonEmpty a) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (DList a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Eq a, Hashable a, FromJSON a) => FromJSON (InsOrdHashSet a) | |
Defined in Data.HashSet.InsOrd Methods parseJSON :: Value -> Parser (InsOrdHashSet a) # parseJSONList :: Value -> Parser [InsOrdHashSet a] # omittedField :: Maybe (InsOrdHashSet a) # | |
| FromJSON a => FromJSON (Array a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Prim a, FromJSON a) => FromJSON (PrimArray a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (SmallArray a) | |
Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser (SmallArray a) # parseJSONList :: Value -> Parser [SmallArray a] # omittedField :: Maybe (SmallArray a) # | |
| FromJSON a => FromJSON (Wrapped a) Source # | |
Defined in Google.Protobuf.Wrappers.Polymorphic | |
| (Message message, FromJSONPB message) => FromJSON (MessageEncoding message) Source # | |
Defined in Proto3.Suite.Form.Encode Methods parseJSON :: Value -> Parser (MessageEncoding message) # parseJSONList :: Value -> Parser [MessageEncoding message] # omittedField :: Maybe (MessageEncoding message) # | |
| (Message message, FromJSONPB message) => FromJSON (MessageEncoder message) Source # | |
Defined in Proto3.Suite.Form.Encode Methods parseJSON :: Value -> Parser (MessageEncoder message) # parseJSONList :: Value -> Parser [MessageEncoder message] # omittedField :: Maybe (MessageEncoder message) # | |
| FromJSON a => FromJSON (Maybe a) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON (CollectionFormat ('SwaggerKindNormal t)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (CollectionFormat ('SwaggerKindNormal t)) # parseJSONList :: Value -> Parser [CollectionFormat ('SwaggerKindNormal t)] # omittedField :: Maybe (CollectionFormat ('SwaggerKindNormal t)) # | |
| FromJSON (CollectionFormat ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (CollectionFormat ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [CollectionFormat ('SwaggerKindParamOtherSchema :: SwaggerKind Type)] # omittedField :: Maybe (CollectionFormat ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |
| (FromJSON (SwaggerType ('SwaggerKindNormal t)), FromJSON (SwaggerItems ('SwaggerKindNormal t))) => FromJSON (ParamSchema ('SwaggerKindNormal t)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (ParamSchema ('SwaggerKindNormal t)) # parseJSONList :: Value -> Parser [ParamSchema ('SwaggerKindNormal t)] # omittedField :: Maybe (ParamSchema ('SwaggerKindNormal t)) # | |
| FromJSON (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)] # omittedField :: Maybe (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |
| FromJSON (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)] # omittedField :: Maybe (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # | |
| FromJSON (Referenced Param) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (Referenced Param) # parseJSONList :: Value -> Parser [Referenced Param] # omittedField :: Maybe (Referenced Param) # | |
| FromJSON (Referenced Response) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (Referenced Response) # parseJSONList :: Value -> Parser [Referenced Response] # omittedField :: Maybe (Referenced Response) # | |
| FromJSON (Referenced Schema) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (Referenced Schema) # parseJSONList :: Value -> Parser [Referenced Schema] # omittedField :: Maybe (Referenced Schema) # | |
| (FromJSON (CollectionFormat ('SwaggerKindNormal t)), FromJSON (ParamSchema ('SwaggerKindNormal t))) => FromJSON (SwaggerItems ('SwaggerKindNormal t)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerItems ('SwaggerKindNormal t)) # parseJSONList :: Value -> Parser [SwaggerItems ('SwaggerKindNormal t)] # omittedField :: Maybe (SwaggerItems ('SwaggerKindNormal t)) # | |
| FromJSON (SwaggerItems ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerItems ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [SwaggerItems ('SwaggerKindParamOtherSchema :: SwaggerKind Type)] # omittedField :: Maybe (SwaggerItems ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |
| FromJSON (SwaggerItems ('SwaggerKindSchema :: SwaggerKind Type)) |
|
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerItems ('SwaggerKindSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [SwaggerItems ('SwaggerKindSchema :: SwaggerKind Type)] # omittedField :: Maybe (SwaggerItems ('SwaggerKindSchema :: SwaggerKind Type)) # | |
| FromJSON (SwaggerType ('SwaggerKindNormal t)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerType ('SwaggerKindNormal t)) # parseJSONList :: Value -> Parser [SwaggerType ('SwaggerKindNormal t)] # omittedField :: Maybe (SwaggerType ('SwaggerKindNormal t)) # | |
| FromJSON (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)] # omittedField :: Maybe (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |
| FromJSON (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)] # omittedField :: Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # | |
| (Eq a, Hashable a, FromJSON a) => FromJSON (HashSet a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Vector a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Prim a, FromJSON a) => FromJSON (Vector a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Storable a, FromJSON a) => FromJSON (Vector a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Vector Vector a, FromJSON a) => FromJSON (Vector a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Maybe a) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Solo a) | Since: aeson-2.0.2.0 |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON [a] | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b) => FromJSON (Either a b) | |
Defined in Data.Aeson.Types.FromJSON | |
| HasResolution a => FromJSON (Fixed a) | This instance includes a bounds check to prevent maliciously
large inputs to fill up the memory of the target system. You can
newtype |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON (Proxy a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSONKey k, Ord k, FromJSON v) => FromJSON (Map k v) | |
Defined in Data.Aeson.Types.FromJSON | |
| (Eq k, Hashable k, FromJSONKey k, FromJSON v) => FromJSON (InsOrdHashMap k v) | |
Defined in Data.HashMap.Strict.InsOrd Methods parseJSON :: Value -> Parser (InsOrdHashMap k v) # parseJSONList :: Value -> Parser [InsOrdHashMap k v] # omittedField :: Maybe (InsOrdHashMap k v) # | |
| (FromJSON a, FromJSON b) => FromJSON (Either a b) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b) => FromJSON (These a b) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b) => FromJSON (Pair a b) | Since: aeson-1.5.3.0 |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b) => FromJSON (These a b) | Since: aeson-1.5.1.0 |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON v, FromJSONKey k, Eq k, Hashable k) => FromJSON (HashMap k v) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b) => FromJSON (a, b) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON a => FromJSON (Const a b) | |
Defined in Data.Aeson.Types.FromJSON | |
| FromJSON b => FromJSON (Tagged a b) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON1 f, FromJSON1 g, FromJSON a) => FromJSON (These1 f g a) | Since: aeson-1.5.1.0 |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c) => FromJSON (a, b, c) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON1 f, FromJSON1 g, FromJSON a) => FromJSON (Product f g a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON1 f, FromJSON1 g, FromJSON a) => FromJSON (Sum f g a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d) => FromJSON (a, b, c, d) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON1 f, FromJSON1 g, FromJSON a) => FromJSON (Compose f g a) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e) => FromJSON (a, b, c, d, e) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f) => FromJSON (a, b, c, d, e, f) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g) => FromJSON (a, b, c, d, e, f, g) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h) => FromJSON (a, b, c, d, e, f, g, h) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i) => FromJSON (a, b, c, d, e, f, g, h, i) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j) => FromJSON (a, b, c, d, e, f, g, h, i, j) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k) => FromJSON (a, b, c, d, e, f, g, h, i, j, k) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m, FromJSON n) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
Defined in Data.Aeson.Types.FromJSON | |
| (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e, FromJSON f, FromJSON g, FromJSON h, FromJSON i, FromJSON j, FromJSON k, FromJSON l, FromJSON m, FromJSON n, FromJSON o) => FromJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
Defined in Data.Aeson.Types.FromJSON | |
Arguments
| :: String | The name of the JSON type being parsed
( |
| -> Value | The actual value encountered. |
| -> Parser a |
Fail parsing due to a type mismatch, with a descriptive message.
The following wrappers should generally be preferred:
withObject, withArray, withText, withBool.
Error message example
typeMismatch "Object" (String "oops") -- Error: "expected Object, but encountered String"
withObject :: String -> (Object -> Parser a) -> Value -> Parser a #
applies withObject name f valuef to the Object when value
is an Object and fails otherwise.
Error message example
withObject "MyType" f (String "oops") -- Error: "parsing MyType failed, expected Object, but encountered String"
Swagger schema helpers
Convert a type into .Schema
An example type and instance:
{-# LANGUAGE OverloadedStrings #-} -- allows to write Text literals
{-# LANGUAGE OverloadedLists #-} -- allows to write Map and HashMap as lists
import Control.Lens
import Data.Proxy
import Data.Swagger
data Coord = Coord { x :: Double, y :: Double }
instance ToSchema Coord where
declareNamedSchema _ = do
doubleSchema <- declareSchemaRef (Proxy :: Proxy Double)
return $ NamedSchema (Just "Coord") $ mempty
& type_ ?~ SwaggerObject
& properties .~
[ ("x", doubleSchema)
, ("y", doubleSchema)
]
& required .~ [ "x", "y" ]
Instead of manually writing your instance you can
use a default generic implementation of ToSchema.declareNamedSchema
To do that, simply add deriving clause to your datatype
and declare a Generic instance for your datatype without
giving definition for ToSchema.declareNamedSchema
For instance, the previous example can be simplified into this:
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics (Generic)
data Coord = Coord { x :: Double, y :: Double } deriving Generic
instance ToSchema Coord
Minimal complete definition
Nothing
Methods
declareNamedSchema :: Proxy a -> Declare (Definitions Schema) NamedSchema #
Convert a type into an optionally named schema together with all used definitions. Note that the schema itself is included in definitions only if it is recursive (and thus needs its definition in scope).
default declareNamedSchema :: (Generic a, GToSchema (Rep a), TypeHasSimpleShape a "genericDeclareNamedSchemaUnrestricted") => Proxy a -> Declare (Definitions Schema) NamedSchema #
Instances
| ToSchema Object | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Object -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema All | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy All -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Any | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Any -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Version | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Version -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Int16 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Int16 -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Int32 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Int32 -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Int64 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Int64 -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Int8 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Int8 -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Word16 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Word16 -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Word32 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Word32 -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Word64 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Word64 -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Word8 | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Word8 -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchemaByteStringError ByteString :: Constraint) => ToSchema ByteString | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy ByteString -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchemaByteStringError ByteString :: Constraint) => ToSchema ByteString | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy ByteString -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema IntSet | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy IntSet -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Timestamp Source # | |
Defined in Google.Protobuf.Timestamp Methods declareNamedSchema :: Proxy Timestamp -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Scientific | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Scientific -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Text | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Text -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Text | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Text -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Day | Format |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Day -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema NominalDiffTime | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy NominalDiffTime -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema UTCTime |
|
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy UTCTime -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema LocalTime |
|
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy LocalTime -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema TimeOfDay | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy TimeOfDay -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema ZonedTime | Format |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy ZonedTime -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema UUID | For |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy UUID -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema String | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy String -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Integer | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Integer -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Natural | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Natural -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema () | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy () -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Bool | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Bool -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Char | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Char -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Double | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Double -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Float | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Float -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Int | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Int -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema Word | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy Word -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Identity a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Identity a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (First a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (First a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Last a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Last a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Dual a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Dual a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Product a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Product a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Sum a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Sum a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (NonEmpty a) | Since: swagger2-2.2.1 |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (NonEmpty a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (IntMap a) | NOTE: This schema does not account for the uniqueness of keys. |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (IntMap a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Set a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Set a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Wrapped a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (Wrapped a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema (Bytes a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (Bytes a) -> Declare (Definitions Schema) NamedSchema # | |
| (Finite e, Named e) => ToSchema (Enumerated e) Source # | JSONPB schemas for protobuf enumerations |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (Enumerated e) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Fixed a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (Fixed a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (ForceEmit a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (ForceEmit a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema (Maybe a) => ToSchema (Nested a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (Nested a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (NestedVec a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (NestedVec a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (PackedVec a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (PackedVec a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Signed a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (Signed a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema (String a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (String a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (UnpackedVec a) Source # | |
Defined in Proto3.Suite.DotProto.Generate.Swagger Methods declareNamedSchema :: Proxy (UnpackedVec a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (HashSet a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (HashSet a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Vector a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Vector a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Vector a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Vector a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Vector a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Vector a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Vector a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Vector a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema (Maybe a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Maybe a) -> Declare (Definitions Schema) NamedSchema # | |
| ToSchema a => ToSchema [a] | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy [a] -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchema a, ToSchema b) => ToSchema (Either a b) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Either a b) -> Declare (Definitions Schema) NamedSchema # | |
| HasResolution a => ToSchema (Fixed a) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Fixed a) -> Declare (Definitions Schema) NamedSchema # | |
| (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (Map k v) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (Map k v) -> Declare (Definitions Schema) NamedSchema # | |
| (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (HashMap k v) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (HashMap k v) -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchema a, ToSchema b) => ToSchema (a, b) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (a, b) -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchema a, ToSchema b, ToSchema c) => ToSchema (a, b, c) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (a, b, c) -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchema a, ToSchema b, ToSchema c, ToSchema d) => ToSchema (a, b, c, d) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (a, b, c, d) -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchema a, ToSchema b, ToSchema c, ToSchema d, ToSchema e) => ToSchema (a, b, c, d, e) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (a, b, c, d, e) -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchema a, ToSchema b, ToSchema c, ToSchema d, ToSchema e, ToSchema f) => ToSchema (a, b, c, d, e, f) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (a, b, c, d, e, f) -> Declare (Definitions Schema) NamedSchema # | |
| (ToSchema a, ToSchema b, ToSchema c, ToSchema d, ToSchema e, ToSchema f, ToSchema g) => ToSchema (a, b, c, d, e, f, g) | |
Defined in Data.Swagger.Internal.Schema Methods declareNamedSchema :: Proxy (a, b, c, d, e, f, g) -> Declare (Definitions Schema) NamedSchema # | |
data NamedSchema #
A with an optional name.
This name can be used in references.Schema
Constructors
| NamedSchema | |
Fields | |
Instances
| Data NamedSchema | |||||
Defined in Data.Swagger.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NamedSchema -> c NamedSchema # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NamedSchema # toConstr :: NamedSchema -> Constr # dataTypeOf :: NamedSchema -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NamedSchema) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NamedSchema) # gmapT :: (forall b. Data b => b -> b) -> NamedSchema -> NamedSchema # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NamedSchema -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NamedSchema -> r # gmapQ :: (forall d. Data d => d -> u) -> NamedSchema -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NamedSchema -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NamedSchema -> m NamedSchema # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NamedSchema -> m NamedSchema # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NamedSchema -> m NamedSchema # | |||||
| Generic NamedSchema | |||||
Defined in Data.Swagger.Internal Associated Types
| |||||
| Show NamedSchema | |||||
Defined in Data.Swagger.Internal Methods showsPrec :: Int -> NamedSchema -> ShowS # show :: NamedSchema -> String # showList :: [NamedSchema] -> ShowS # | |||||
| Eq NamedSchema | |||||
Defined in Data.Swagger.Internal | |||||
| HasSchema NamedSchema Schema | |||||
Defined in Data.Swagger.Lens Methods | |||||
| HasName NamedSchema (Maybe Text) | |||||
Defined in Data.Swagger.Lens | |||||
| HasParamSchema NamedSchema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Lens Methods paramSchema :: Lens' NamedSchema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # | |||||
| HasType NamedSchema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) | |||||
Defined in Data.Swagger.Lens Methods type_ :: Lens' NamedSchema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) # | |||||
| type Rep NamedSchema | |||||
Defined in Data.Swagger.Internal type Rep NamedSchema = D1 ('MetaData "NamedSchema" "Data.Swagger.Internal" "swagger2-2.8.10-9otvKJeyQD4G7NbWrgFMfJ" 'False) (C1 ('MetaCons "NamedSchema" 'PrefixI 'True) (S1 ('MetaSel ('Just "_namedSchemaName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_namedSchemaSchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Schema))) | |||||
Constructors
| Schema | |
Fields
| |
Instances
| FromJSON Schema | |||||
Defined in Data.Swagger.Internal | |||||
| ToJSON Schema | |||||
| Data Schema | |||||
Defined in Data.Swagger.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Schema -> c Schema # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Schema # toConstr :: Schema -> Constr # dataTypeOf :: Schema -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Schema) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Schema) # gmapT :: (forall b. Data b => b -> b) -> Schema -> Schema # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Schema -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Schema -> r # gmapQ :: (forall d. Data d => d -> u) -> Schema -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Schema -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Schema -> m Schema # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Schema -> m Schema # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Schema -> m Schema # | |||||
| Monoid Schema | |||||
| Semigroup Schema | |||||
| Generic Schema | |||||
Defined in Data.Swagger.Internal Associated Types
| |||||
| Show Schema | |||||
| Generic Schema | |||||
Defined in Data.Swagger.Internal Associated Types
| |||||
| HasDatatypeInfo Schema | |||||
Defined in Data.Swagger.Internal Associated Types
Methods datatypeInfo :: proxy Schema -> DatatypeInfo (Code Schema) # | |||||
| Eq Schema | |||||
| HasSwaggerAesonOptions Schema | |||||
Defined in Data.Swagger.Internal Methods swaggerAesonOptions :: Proxy Schema -> SwaggerAesonOptions # | |||||
| SwaggerMonoid Schema | |||||
Defined in Data.Swagger.Internal | |||||
| HasSchema NamedSchema Schema | |||||
Defined in Data.Swagger.Lens Methods | |||||
| HasAdditionalProperties Schema (Maybe AdditionalProperties) | |||||
Defined in Data.Swagger.Lens Methods additionalProperties :: Lens' Schema (Maybe AdditionalProperties) # | |||||
| HasAllOf Schema (Maybe [Referenced Schema]) | |||||
Defined in Data.Swagger.Lens | |||||
| HasDefault Schema (Maybe Value) | |||||
| HasDefinitions Swagger (Definitions Schema) | |||||
Defined in Data.Swagger.Lens Methods | |||||
| HasDescription Schema (Maybe Text) | |||||
Defined in Data.Swagger.Lens | |||||
| HasDiscriminator Schema (Maybe Text) | |||||
Defined in Data.Swagger.Lens | |||||
| HasExample Schema (Maybe Value) | |||||
| HasExternalDocs Schema (Maybe ExternalDocs) | |||||
Defined in Data.Swagger.Lens Methods | |||||
| HasMaxProperties Schema (Maybe Integer) | |||||
Defined in Data.Swagger.Lens | |||||
| HasMinProperties Schema (Maybe Integer) | |||||
Defined in Data.Swagger.Lens | |||||
| HasParamSchema Schema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Lens Methods paramSchema :: Lens' Schema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # | |||||
| HasReadOnly Schema (Maybe Bool) | |||||
| HasRequired Schema [ParamName] | |||||
| HasSchema Response (Maybe (Referenced Schema)) | |||||
Defined in Data.Swagger.Lens | |||||
| HasTitle Schema (Maybe Text) | |||||
| HasType Schema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) | |||||
Defined in Data.Swagger.Lens Methods type_ :: Lens' Schema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) # | |||||
| HasXml Schema (Maybe Xml) | |||||
| HasProperties Schema (InsOrdHashMap Text (Referenced Schema)) | |||||
Defined in Data.Swagger.Lens Methods properties :: Lens' Schema (InsOrdHashMap Text (Referenced Schema)) # | |||||
| FromJSON (Referenced Schema) | |||||
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (Referenced Schema) # parseJSONList :: Value -> Parser [Referenced Schema] # omittedField :: Maybe (Referenced Schema) # | |||||
| ToJSON (Referenced Schema) | |||||
Defined in Data.Swagger.Internal Methods toJSON :: Referenced Schema -> Value # toEncoding :: Referenced Schema -> Encoding # toJSONList :: [Referenced Schema] -> Value # toEncodingList :: [Referenced Schema] -> Encoding # omitField :: Referenced Schema -> Bool # | |||||
| type Rep Schema | |||||
Defined in Data.Swagger.Internal type Rep Schema = D1 ('MetaData "Schema" "Data.Swagger.Internal" "swagger2-2.8.10-9otvKJeyQD4G7NbWrgFMfJ" 'False) (C1 ('MetaCons "Schema" 'PrefixI 'True) (((S1 ('MetaSel ('Just "_schemaTitle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "_schemaDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_schemaRequired") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ParamName]))) :*: ((S1 ('MetaSel ('Just "_schemaAllOf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Referenced Schema])) :*: S1 ('MetaSel ('Just "_schemaProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (InsOrdHashMap Text (Referenced Schema)))) :*: (S1 ('MetaSel ('Just "_schemaAdditionalProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AdditionalProperties)) :*: S1 ('MetaSel ('Just "_schemaDiscriminator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) :*: ((S1 ('MetaSel ('Just "_schemaReadOnly") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "_schemaXml") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Xml)) :*: S1 ('MetaSel ('Just "_schemaExternalDocs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ExternalDocs)))) :*: ((S1 ('MetaSel ('Just "_schemaExample") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value)) :*: S1 ('MetaSel ('Just "_schemaMaxProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer))) :*: (S1 ('MetaSel ('Just "_schemaMinProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "_schemaParamSchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)))))))) | |||||
| type Code Schema | |||||
Defined in Data.Swagger.Internal type Code Schema = '['[Maybe Text, Maybe Text, [ParamName], Maybe [Referenced Schema], InsOrdHashMap Text (Referenced Schema), Maybe AdditionalProperties, Maybe Text, Maybe Bool, Maybe Xml, Maybe ExternalDocs, Maybe Value, Maybe Integer, Maybe Integer, ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)]] | |||||
| type DatatypeInfoOf Schema | |||||
Defined in Data.Swagger.Internal type DatatypeInfoOf Schema = 'ADT "Data.Swagger.Internal" "Schema" '['Record "Schema" '['FieldInfo "_schemaTitle", 'FieldInfo "_schemaDescription", 'FieldInfo "_schemaRequired", 'FieldInfo "_schemaAllOf", 'FieldInfo "_schemaProperties", 'FieldInfo "_schemaAdditionalProperties", 'FieldInfo "_schemaDiscriminator", 'FieldInfo "_schemaReadOnly", 'FieldInfo "_schemaXml", 'FieldInfo "_schemaExternalDocs", 'FieldInfo "_schemaExample", 'FieldInfo "_schemaMaxProperties", 'FieldInfo "_schemaMinProperties", 'FieldInfo "_schemaParamSchema"]] '['['StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy]] | |||||
data ParamSchema (t :: SwaggerKind Type) #
Constructors
| ParamSchema | |
Fields
| |
Instances
| HasParamSchema Header (ParamSchema ('SwaggerKindNormal Header)) | |||||
Defined in Data.Swagger.Lens Methods paramSchema :: Lens' Header (ParamSchema ('SwaggerKindNormal Header)) # | |||||
| HasParamSchema NamedSchema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Lens Methods paramSchema :: Lens' NamedSchema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # | |||||
| HasParamSchema ParamOtherSchema (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Lens Methods paramSchema :: Lens' ParamOtherSchema (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |||||
| HasParamSchema Schema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Lens Methods paramSchema :: Lens' Schema (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # | |||||
| (FromJSON (SwaggerType ('SwaggerKindNormal t)), FromJSON (SwaggerItems ('SwaggerKindNormal t))) => FromJSON (ParamSchema ('SwaggerKindNormal t)) | |||||
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (ParamSchema ('SwaggerKindNormal t)) # parseJSONList :: Value -> Parser [ParamSchema ('SwaggerKindNormal t)] # omittedField :: Maybe (ParamSchema ('SwaggerKindNormal t)) # | |||||
| FromJSON (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)] # omittedField :: Maybe (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |||||
| FromJSON (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)] # omittedField :: Maybe (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) # | |||||
| ToJSON (ParamSchema k) | |||||
Defined in Data.Swagger.Internal Methods toJSON :: ParamSchema k -> Value # toEncoding :: ParamSchema k -> Encoding # toJSONList :: [ParamSchema k] -> Value # toEncodingList :: [ParamSchema k] -> Encoding # omitField :: ParamSchema k -> Bool # | |||||
| (Typeable k, Data (Maybe (SwaggerType k)), Data (SwaggerItems k)) => Data (ParamSchema k) | |||||
Defined in Data.Swagger.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ParamSchema k -> c (ParamSchema k) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ParamSchema k) # toConstr :: ParamSchema k -> Constr # dataTypeOf :: ParamSchema k -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ParamSchema k)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ParamSchema k)) # gmapT :: (forall b. Data b => b -> b) -> ParamSchema k -> ParamSchema k # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ParamSchema k -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ParamSchema k -> r # gmapQ :: (forall d. Data d => d -> u) -> ParamSchema k -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ParamSchema k -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ParamSchema k -> m (ParamSchema k) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ParamSchema k -> m (ParamSchema k) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ParamSchema k -> m (ParamSchema k) # | |||||
| Monoid (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Methods mempty :: ParamSchema t # mappend :: ParamSchema t -> ParamSchema t -> ParamSchema t # mconcat :: [ParamSchema t] -> ParamSchema t # | |||||
| Semigroup (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Methods (<>) :: ParamSchema t -> ParamSchema t -> ParamSchema t # sconcat :: NonEmpty (ParamSchema t) -> ParamSchema t # stimes :: Integral b => b -> ParamSchema t -> ParamSchema t # | |||||
| Generic (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Associated Types
Methods from :: ParamSchema t -> Rep (ParamSchema t) x # to :: Rep (ParamSchema t) x -> ParamSchema t # | |||||
| Show (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Methods showsPrec :: Int -> ParamSchema t -> ShowS # show :: ParamSchema t -> String # showList :: [ParamSchema t] -> ShowS # | |||||
| Generic (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Associated Types
| |||||
| HasDatatypeInfo (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Associated Types
Methods datatypeInfo :: proxy (ParamSchema t) -> DatatypeInfo (Code (ParamSchema t)) # | |||||
| Eq (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Methods (==) :: ParamSchema t -> ParamSchema t -> Bool # (/=) :: ParamSchema t -> ParamSchema t -> Bool # | |||||
| AesonDefaultValue (ParamSchema s) | |||||
Defined in Data.Swagger.Internal Methods defaultValue :: Maybe (ParamSchema s) # | |||||
| HasSwaggerAesonOptions (ParamSchema ('SwaggerKindNormal t)) | |||||
Defined in Data.Swagger.Internal Methods swaggerAesonOptions :: Proxy (ParamSchema ('SwaggerKindNormal t)) -> SwaggerAesonOptions # aesonDefaults :: Proxy (ParamSchema ('SwaggerKindNormal t)) -> POP Maybe (Code (ParamSchema ('SwaggerKindNormal t))) # | |||||
| HasSwaggerAesonOptions (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Internal Methods swaggerAesonOptions :: Proxy (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) -> SwaggerAesonOptions # aesonDefaults :: Proxy (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) -> POP Maybe (Code (ParamSchema ('SwaggerKindParamOtherSchema :: SwaggerKind Type))) # | |||||
| HasSwaggerAesonOptions (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) | |||||
Defined in Data.Swagger.Internal Methods swaggerAesonOptions :: Proxy (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) -> SwaggerAesonOptions # aesonDefaults :: Proxy (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type)) -> POP Maybe (Code (ParamSchema ('SwaggerKindSchema :: SwaggerKind Type))) # | |||||
| SwaggerMonoid (ParamSchema t) | |||||
Defined in Data.Swagger.Internal Methods swaggerMempty :: ParamSchema t # swaggerMappend :: ParamSchema t -> ParamSchema t -> ParamSchema t # | |||||
| HasDefault (ParamSchema t) (Maybe Value) | |||||
Defined in Data.Swagger.Lens | |||||
| HasEnum (ParamSchema t) (Maybe [Value]) | |||||
Defined in Data.Swagger.Lens | |||||
| HasExclusiveMaximum (ParamSchema t) (Maybe Bool) | |||||
Defined in Data.Swagger.Lens Methods exclusiveMaximum :: Lens' (ParamSchema t) (Maybe Bool) # | |||||
| HasExclusiveMinimum (ParamSchema t) (Maybe Bool) | |||||
Defined in Data.Swagger.Lens Methods exclusiveMinimum :: Lens' (ParamSchema t) (Maybe Bool) # | |||||
| HasFormat (ParamSchema t) (Maybe Format) | |||||
Defined in Data.Swagger.Lens | |||||
| HasItems (ParamSchema t) (Maybe (SwaggerItems t)) | |||||
Defined in Data.Swagger.Lens Methods items :: Lens' (ParamSchema t) (Maybe (SwaggerItems t)) # | |||||
| HasMaxItems (ParamSchema t) (Maybe Integer) | |||||
Defined in Data.Swagger.Lens | |||||
| HasMaxLength (ParamSchema t) (Maybe Integer) | |||||
Defined in Data.Swagger.Lens | |||||
| HasMaximum (ParamSchema t) (Maybe Scientific) | |||||
Defined in Data.Swagger.Lens Methods maximum_ :: Lens' (ParamSchema t) (Maybe Scientific) # | |||||
| HasMinItems (ParamSchema t) (Maybe Integer) | |||||
Defined in Data.Swagger.Lens | |||||
| HasMinLength (ParamSchema t) (Maybe Integer) | |||||
Defined in Data.Swagger.Lens | |||||
| HasMinimum (ParamSchema t) (Maybe Scientific) | |||||
Defined in Data.Swagger.Lens Methods minimum_ :: Lens' (ParamSchema t) (Maybe Scientific) # | |||||
| HasMultipleOf (ParamSchema t) (Maybe Scientific) | |||||
Defined in Data.Swagger.Lens Methods multipleOf :: Lens' (ParamSchema t) (Maybe Scientific) # | |||||
| HasPattern (ParamSchema t) (Maybe Pattern) | |||||
Defined in Data.Swagger.Lens | |||||
| HasType (ParamSchema t) (Maybe (SwaggerType t)) | |||||
Defined in Data.Swagger.Lens Methods type_ :: Lens' (ParamSchema t) (Maybe (SwaggerType t)) # | |||||
| HasUniqueItems (ParamSchema t) (Maybe Bool) | |||||
Defined in Data.Swagger.Lens Methods uniqueItems :: Lens' (ParamSchema t) (Maybe Bool) # | |||||
| type Rep (ParamSchema t) | |||||
Defined in Data.Swagger.Internal type Rep (ParamSchema t) = D1 ('MetaData "ParamSchema" "Data.Swagger.Internal" "swagger2-2.8.10-9otvKJeyQD4G7NbWrgFMfJ" 'False) (C1 ('MetaCons "ParamSchema" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "_paramSchemaDefault") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value)) :*: S1 ('MetaSel ('Just "_paramSchemaType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (SwaggerType t)))) :*: (S1 ('MetaSel ('Just "_paramSchemaFormat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Format)) :*: S1 ('MetaSel ('Just "_paramSchemaItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (SwaggerItems t))))) :*: ((S1 ('MetaSel ('Just "_paramSchemaMaximum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Scientific)) :*: S1 ('MetaSel ('Just "_paramSchemaExclusiveMaximum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "_paramSchemaMinimum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Scientific)) :*: S1 ('MetaSel ('Just "_paramSchemaExclusiveMinimum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) :*: (((S1 ('MetaSel ('Just "_paramSchemaMaxLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "_paramSchemaMinLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer))) :*: (S1 ('MetaSel ('Just "_paramSchemaPattern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Pattern)) :*: S1 ('MetaSel ('Just "_paramSchemaMaxItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer)))) :*: ((S1 ('MetaSel ('Just "_paramSchemaMinItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "_paramSchemaUniqueItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "_paramSchemaEnum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Value])) :*: S1 ('MetaSel ('Just "_paramSchemaMultipleOf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Scientific))))))) | |||||
| type Code (ParamSchema t) | |||||
Defined in Data.Swagger.Internal | |||||
| type DatatypeInfoOf (ParamSchema t) | |||||
Defined in Data.Swagger.Internal type DatatypeInfoOf (ParamSchema t) = 'ADT "Data.Swagger.Internal" "ParamSchema" '['Record "ParamSchema" '['FieldInfo "_paramSchemaDefault", 'FieldInfo "_paramSchemaType", 'FieldInfo "_paramSchemaFormat", 'FieldInfo "_paramSchemaItems", 'FieldInfo "_paramSchemaMaximum", 'FieldInfo "_paramSchemaExclusiveMaximum", 'FieldInfo "_paramSchemaMinimum", 'FieldInfo "_paramSchemaExclusiveMinimum", 'FieldInfo "_paramSchemaMaxLength", 'FieldInfo "_paramSchemaMinLength", 'FieldInfo "_paramSchemaPattern", 'FieldInfo "_paramSchemaMaxItems", 'FieldInfo "_paramSchemaMinItems", 'FieldInfo "_paramSchemaUniqueItems", 'FieldInfo "_paramSchemaEnum", 'FieldInfo "_paramSchemaMultipleOf"]] '['['StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy, 'StrictnessInfo 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy]] | |||||
data SwaggerType (t :: SwaggerKind Type) where #
Constructors
| 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
| HasType Header (Maybe (SwaggerType ('SwaggerKindNormal Header))) | |
Defined in Data.Swagger.Lens Methods type_ :: Lens' Header (Maybe (SwaggerType ('SwaggerKindNormal Header))) # | |
| HasType NamedSchema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) | |
Defined in Data.Swagger.Lens Methods type_ :: Lens' NamedSchema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) # | |
| HasType ParamOtherSchema (Maybe (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type))) | |
Defined in Data.Swagger.Lens Methods type_ :: Lens' ParamOtherSchema (Maybe (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type))) # | |
| HasType Schema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) | |
Defined in Data.Swagger.Lens Methods type_ :: Lens' Schema (Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) # | |
| FromJSON (SwaggerType ('SwaggerKindNormal t)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerType ('SwaggerKindNormal t)) # parseJSONList :: Value -> Parser [SwaggerType ('SwaggerKindNormal t)] # omittedField :: Maybe (SwaggerType ('SwaggerKindNormal t)) # | |
| FromJSON (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)] # omittedField :: Maybe (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |
| FromJSON (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods parseJSON :: Value -> Parser (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # parseJSONList :: Value -> Parser [SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)] # omittedField :: Maybe (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # | |
| ToJSON (SwaggerType t) | |
Defined in Data.Swagger.Internal Methods toJSON :: SwaggerType t -> Value # toEncoding :: SwaggerType t -> Encoding # toJSONList :: [SwaggerType t] -> Value # toEncodingList :: [SwaggerType t] -> Encoding # omitField :: SwaggerType t -> Bool # | |
| Typeable t => Data (SwaggerType ('SwaggerKindNormal t)) | |
Defined in Data.Swagger.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SwaggerType ('SwaggerKindNormal t) -> c (SwaggerType ('SwaggerKindNormal t)) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SwaggerType ('SwaggerKindNormal t)) # toConstr :: SwaggerType ('SwaggerKindNormal t) -> Constr # dataTypeOf :: SwaggerType ('SwaggerKindNormal t) -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (SwaggerType ('SwaggerKindNormal t))) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (SwaggerType ('SwaggerKindNormal t))) # gmapT :: (forall b. Data b => b -> b) -> SwaggerType ('SwaggerKindNormal t) -> SwaggerType ('SwaggerKindNormal t) # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SwaggerType ('SwaggerKindNormal t) -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SwaggerType ('SwaggerKindNormal t) -> r # gmapQ :: (forall d. Data d => d -> u) -> SwaggerType ('SwaggerKindNormal t) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SwaggerType ('SwaggerKindNormal t) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindNormal t) -> m (SwaggerType ('SwaggerKindNormal t)) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindNormal t) -> m (SwaggerType ('SwaggerKindNormal t)) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindNormal t) -> m (SwaggerType ('SwaggerKindNormal t)) # | |
| Data (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> c (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # toConstr :: SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> Constr # dataTypeOf :: SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type))) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type))) # gmapT :: (forall b. Data b => b -> b) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> r # gmapQ :: (forall d. Data d => d -> u) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> m (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> m (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type) -> m (SwaggerType ('SwaggerKindParamOtherSchema :: SwaggerKind Type)) # | |
| Data (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) | |
Defined in Data.Swagger.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> c (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # toConstr :: SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> Constr # dataTypeOf :: SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type))) # gmapT :: (forall b. Data b => b -> b) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> r # gmapQ :: (forall d. Data d => d -> u) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> m (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> m (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SwaggerType ('SwaggerKindSchema :: SwaggerKind Type) -> m (SwaggerType ('SwaggerKindSchema :: SwaggerKind Type)) # | |
| Show (SwaggerType t) | |
Defined in Data.Swagger.Internal Methods showsPrec :: Int -> SwaggerType t -> ShowS # show :: SwaggerType t -> String # showList :: [SwaggerType t] -> ShowS # | |
| Eq (SwaggerType t) | |
Defined in Data.Swagger.Internal Methods (==) :: SwaggerType t -> SwaggerType t -> Bool # (/=) :: SwaggerType t -> SwaggerType t -> Bool # | |
| AesonDefaultValue (SwaggerType a) | |
Defined in Data.Swagger.Internal Methods defaultValue :: Maybe (SwaggerType a) # | |
| SwaggerMonoid (SwaggerType t) | |
Defined in Data.Swagger.Internal Methods swaggerMempty :: SwaggerType t # swaggerMappend :: SwaggerType t -> SwaggerType t -> SwaggerType t # | |
| HasType (ParamSchema t) (Maybe (SwaggerType t)) | |
Defined in Data.Swagger.Lens Methods type_ :: Lens' (ParamSchema t) (Maybe (SwaggerType t)) # | |
declareSchemaRef :: ToSchema a => Proxy a -> Declare (Definitions Schema) (Referenced Schema) #
Convert a type into a referenced schema if possible and declare all used schema definitions. Only named schemas can be referenced, nameless schemas are inlined.
Schema definitions are typically declared for every referenced schema.
If returns a reference, a corresponding schema
will be declared (regardless of whether it is recusive or not).declareSchemaRef
asProxy :: (Proxy a -> b) -> Proxy a Source #
This is a convenience function that uses type inference to select the
correct instance of ToSchema to use for fields of a message
insOrdFromList :: (Eq k, Hashable k) => [(k, v)] -> InsOrdHashMap k v Source #
Convenience re-export so that users of generated code don't have to add
an explicit dependency on insert-ordered-containers