-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add typeOptions support for oneOf/Unions
- Loading branch information
Showing
8 changed files
with
58 additions
and
12 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
27 changes: 27 additions & 0 deletions
27
...ece-openapi3/examples/test-cases/TestCases/Types/DateTimeFormats/ZonedTimeInUnionField.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,27 @@ | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
{-# LANGUAGE DataKinds #-} | ||
|
||
module TestCases.Types.DateTimeFormats.ZonedTimeInUnionField | ||
( ZonedTimeInUnionField(..) | ||
, zonedTimeInUnionFieldSchema | ||
) where | ||
|
||
import qualified Data.Text as T | ||
import Fleece.Core ((#|)) | ||
import qualified Fleece.Core as FC | ||
import Prelude (($), Show) | ||
import qualified Shrubbery as Shrubbery | ||
import qualified TestCases.Types.ZonedTimeType as ZonedTimeType | ||
|
||
newtype ZonedTimeInUnionField = ZonedTimeInUnionField (Shrubbery.Union | ||
'[ ZonedTimeType.ZonedTimeType | ||
, T.Text | ||
]) | ||
deriving (Show) | ||
|
||
zonedTimeInUnionFieldSchema :: FC.Fleece schema => schema ZonedTimeInUnionField | ||
zonedTimeInUnionFieldSchema = | ||
FC.coerceSchema $ | ||
FC.unionNamed (FC.qualifiedName "TestCases.Types.DateTimeFormats.ZonedTimeInUnionField" "ZonedTimeInUnionField") $ | ||
FC.unionMember ZonedTimeType.zonedTimeTypeSchema | ||
#| FC.unionMember FC.text |
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