| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hasura.Metadata.DTO.Placeholder
Description
We are in the process of building DTO types incrementally. We use
placeholder types in positions in data structures that are not fully-defined
yet. For example PlaceholderObject represents some unspecified JSON object,
and PlaceholderArray represents an array whose contents are not yet
specified.
We are transitioning from converting Metadata directly to
JSON to converting it to MetadataDTO
instead. Serialization and deserialization for placeholder values is
delegated to the old JSON serialization code.
Synopsis
- newtype PlaceholderArray = PlaceholderArray Array
- newtype PlaceholderObject = PlaceholderObject Object
- class IsPlaceholder p a | a -> p where
- placeholder :: a -> p
- placeholderCodecViaJSON :: (FromJSON a, ToJSON a) => JSONCodec a
Documentation
newtype PlaceholderArray Source #
Stands in for an array that we have not had time to fully specify yet.
Generated OpenAPI documentation for PlaceholderArray will permit an array
of values of any type, and a note will be appended to the documentation
string for the value explaining that this is a temporary placeholder.
Constructors
| PlaceholderArray Array |
Instances
newtype PlaceholderObject Source #
Stands in for an object that we have not had time to fully specify yet.
Generated OpenAPI documentation for PlaceholderObject will permit an object
with any keys with any types of values. A note will be appended to the
documentation string for the value explaining that this is a temporary
placeholder.
Constructors
| PlaceholderObject Object |
Instances
class IsPlaceholder p a | a -> p where Source #
Methods
placeholder :: a -> p Source #
Use this function to mark an Aeson type (Array or Object) as a temporary placeholder in a larger data structure.
Instances
| IsPlaceholder PlaceholderArray Array Source # | |
Defined in Hasura.Metadata.DTO.Placeholder Methods placeholder :: Array -> PlaceholderArray Source # | |
| IsPlaceholder PlaceholderArray Array Source # | |
Defined in Hasura.Metadata.DTO.Placeholder Methods placeholder :: Array -> PlaceholderArray Source # | |
| IsPlaceholder PlaceholderObject Object Source # | |
Defined in Hasura.Metadata.DTO.Placeholder Methods | |
| IsPlaceholder PlaceholderObject Object Source # | |
Defined in Hasura.Metadata.DTO.Placeholder Methods | |
placeholderCodecViaJSON :: (FromJSON a, ToJSON a) => JSONCodec a Source #
This placeholder can be used in a codec to represent any type of data that
has FromJSON and ToJSON instances. Generated OpenAPI specifications based
on this codec will not show any information about the internal structure of
the type so ideally uses of this placeholder should eventually be replaced
with more descriptive codecs.