-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow format specifier for all date/time types
- Loading branch information
Showing
14 changed files
with
162 additions
and
51 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
17 changes: 17 additions & 0 deletions
17
...eece-openapi3/examples/test-cases/TestCases/Types/DateTimeFormats/CustomLocalTimeField.hs
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,17 @@ | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
|
||
module TestCases.Types.DateTimeFormats.CustomLocalTimeField | ||
( CustomLocalTimeField(..) | ||
, customLocalTimeFieldSchema | ||
) where | ||
|
||
import qualified Data.Time as Time | ||
import qualified Fleece.Core as FC | ||
import Prelude (Eq, Show) | ||
|
||
newtype CustomLocalTimeField = CustomLocalTimeField Time.LocalTime | ||
deriving (Show, Eq) | ||
|
||
customLocalTimeFieldSchema :: FC.Fleece schema => schema CustomLocalTimeField | ||
customLocalTimeFieldSchema = | ||
FC.coerceSchema (FC.localTimeWithFormat "local") |
17 changes: 17 additions & 0 deletions
17
...fleece-openapi3/examples/test-cases/TestCases/Types/DateTimeFormats/CustomUtcTimeField.hs
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,17 @@ | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
|
||
module TestCases.Types.DateTimeFormats.CustomUtcTimeField | ||
( CustomUtcTimeField(..) | ||
, customUtcTimeFieldSchema | ||
) where | ||
|
||
import qualified Data.Time as Time | ||
import qualified Fleece.Core as FC | ||
import Prelude (Eq, Show) | ||
|
||
newtype CustomUtcTimeField = CustomUtcTimeField Time.UTCTime | ||
deriving (Show, Eq) | ||
|
||
customUtcTimeFieldSchema :: FC.Fleece schema => schema CustomUtcTimeField | ||
customUtcTimeFieldSchema = | ||
FC.coerceSchema (FC.utcTimeWithFormat "utc") |
17 changes: 17 additions & 0 deletions
17
...eece-openapi3/examples/test-cases/TestCases/Types/DateTimeFormats/CustomZonedTimeField.hs
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,17 @@ | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
|
||
module TestCases.Types.DateTimeFormats.CustomZonedTimeField | ||
( CustomZonedTimeField(..) | ||
, customZonedTimeFieldSchema | ||
) where | ||
|
||
import qualified Data.Time as Time | ||
import qualified Fleece.Core as FC | ||
import Prelude (Show) | ||
|
||
newtype CustomZonedTimeField = CustomZonedTimeField Time.ZonedTime | ||
deriving (Show) | ||
|
||
customZonedTimeFieldSchema :: FC.Fleece schema => schema CustomZonedTimeField | ||
customZonedTimeFieldSchema = | ||
FC.coerceSchema (FC.zonedTimeWithFormat "zoned") |
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
Oops, something went wrong.