-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
7 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator. | ||
|
||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE MultiWayIf #-} | ||
|
||
-- | Contains the types generated from the schema Value | ||
module OpenAPI.Types.Value where | ||
|
||
import qualified Prelude as GHC.Integer.Type | ||
import qualified Prelude as GHC.Maybe | ||
import qualified Control.Monad.Fail | ||
import qualified Data.Aeson | ||
import qualified Data.Aeson as Data.Aeson.Encoding.Internal | ||
import qualified Data.Aeson as Data.Aeson.Types | ||
import qualified Data.Aeson as Data.Aeson.Types.FromJSON | ||
import qualified Data.Aeson as Data.Aeson.Types.ToJSON | ||
import qualified Data.Aeson as Data.Aeson.Types.Internal | ||
import qualified Data.ByteString | ||
import qualified Data.ByteString as Data.ByteString.Internal | ||
import qualified Data.Foldable | ||
import qualified Data.Functor | ||
import qualified Data.Maybe | ||
import qualified Data.Scientific | ||
import qualified Data.Text | ||
import qualified Data.Text as Data.Text.Internal | ||
import qualified Data.Time.Calendar as Data.Time.Calendar.Days | ||
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime | ||
import qualified GHC.Base | ||
import qualified GHC.Classes | ||
import qualified GHC.Int | ||
import qualified GHC.Show | ||
import qualified GHC.Types | ||
import qualified OpenAPI.Common | ||
import OpenAPI.TypeAlias | ||
|
||
-- | Defines the enum schema located at @components.schemas.Value@ in the specification. | ||
-- | ||
-- | ||
data Value = | ||
ValueOther Data.Aeson.Types.Internal.Value -- ^ This case is used if the value encountered during decoding does not match any of the provided cases in the specification. | ||
| ValueTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | ||
| ValueEnumYyy -- ^ Represents the JSON value @"yyy"@ | ||
deriving (GHC.Show.Show, GHC.Classes.Eq) | ||
instance Data.Aeson.Types.ToJSON.ToJSON Value | ||
where {toJSON (ValueOther val) = val; | ||
toJSON (ValueTyped val) = Data.Aeson.Types.ToJSON.toJSON val; | ||
toJSON (ValueEnumYyy) = "yyy"} | ||
instance Data.Aeson.Types.FromJSON.FromJSON Value | ||
where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "yyy" -> ValueEnumYyy | ||
| GHC.Base.otherwise -> ValueOther val)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module OpenAPI.Types.Value where | ||
import qualified Data.Aeson | ||
import qualified OpenAPI.Common | ||
data Value | ||
instance Show Value | ||
instance Eq Value | ||
instance Data.Aeson.FromJSON Value | ||
instance Data.Aeson.ToJSON Value |