mirror of
https://github.com/facebook/duckling.git
synced 2024-11-24 07:23:03 +03:00
Add type=value to JSON response for Email, PhoneNumber and Url
Summary: For consistency. Reviewed By: jtliao Differential Revision: D20524369 fbshipit-source-id: 44031667adccab9bca7b3b6d42c80878bb96ccae
This commit is contained in:
parent
5d6750208a
commit
7166286a6f
@ -31,4 +31,7 @@ instance Resolve EmailData where
|
||||
resolve _ _ x = Just (x, False)
|
||||
|
||||
instance ToJSON EmailData where
|
||||
toJSON EmailData {value} = object [ "value" .= value ]
|
||||
toJSON EmailData {value} = object
|
||||
[ "value" .= value
|
||||
, "type" .= ("value" :: Text)
|
||||
]
|
||||
|
@ -50,4 +50,7 @@ data PhoneNumberValue = PhoneNumberValue { value :: Text }
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
instance ToJSON PhoneNumberValue where
|
||||
toJSON (PhoneNumberValue value) = object [ "value" .= value ]
|
||||
toJSON (PhoneNumberValue value) = object
|
||||
[ "value" .= value
|
||||
, "type" .= ("value" :: Text)
|
||||
]
|
||||
|
@ -38,4 +38,5 @@ instance ToJSON UrlData where
|
||||
toJSON (UrlData value domain) = object
|
||||
[ "value" .= value
|
||||
, "domain" .= domain
|
||||
, "type" .= ("value" :: Text)
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user