Better tests for string (number) (#3953)

* beter test for string (number)

* fix mapping

* fix mapping in csharp generators
This commit is contained in:
William Cheng
2019-09-30 15:22:44 +08:00
committed by GitHub
parent c8d5701089
commit 7dbda049f0
119 changed files with 1693 additions and 136 deletions

View File

@@ -1075,6 +1075,7 @@ data FormatTest = FormatTest
, formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime"
, formatTestUuid :: !(Maybe Text) -- ^ "uuid"
, formatTestPassword :: !(Text) -- ^ /Required/ "password"
, formatTestBigDecimal :: !(Maybe Double) -- ^ "BigDecimal"
} deriving (P.Show, P.Eq, P.Typeable)
-- | FromJSON FormatTest
@@ -1094,6 +1095,7 @@ instance A.FromJSON FormatTest where
<*> (o .:? "dateTime")
<*> (o .:? "uuid")
<*> (o .: "password")
<*> (o .:? "BigDecimal")
-- | ToJSON FormatTest
instance A.ToJSON FormatTest where
@@ -1112,6 +1114,7 @@ instance A.ToJSON FormatTest where
, "dateTime" .= formatTestDateTime
, "uuid" .= formatTestUuid
, "password" .= formatTestPassword
, "BigDecimal" .= formatTestBigDecimal
]
@@ -1137,6 +1140,7 @@ mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword =
, formatTestDateTime = Nothing
, formatTestUuid = Nothing
, formatTestPassword
, formatTestBigDecimal = Nothing
}
-- ** HasOnlyReadOnly

View File

@@ -487,6 +487,11 @@ formatTestPasswordL :: Lens_' FormatTest (Text)
formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword
{-# INLINE formatTestPasswordL #-}
-- | 'formatTestBigDecimal' Lens
formatTestBigDecimalL :: Lens_' FormatTest (Maybe Double)
formatTestBigDecimalL f FormatTest{..} = (\formatTestBigDecimal -> FormatTest { formatTestBigDecimal, ..} ) <$> f formatTestBigDecimal
{-# INLINE formatTestBigDecimalL #-}
-- * HasOnlyReadOnly