on develop help sign in
Adding support for google-datetime literal type
commite437f32e578290517fe03339187be268b50a72f5 authorBrendan Hay <brendan.g.hay@gmail.com> dateSat 11 Jun 2016, 08:20 (10 years ago) parentecbc697
1 file changed+15−14
gen/src/Gen/Types/Schema.hs+15−14
gen/src/Gen/Types/Schema.hs+15−14
@@ -210,22 +210,23 @@ instance FromJSON Lit where
210210 t <- o .: "format" <|> o .: "type"
211211 case t of
212212 -- Types
213− "string" -> pure Text
214− "boolean" -> pure Bool
213+ "string" -> pure Text
214+ "boolean" -> pure Bool
215215
216216 -- Formats
217− "float" -> pure Float
218− "double" -> pure Double
219− "byte" -> pure Byte
220− "uint32" -> pure UInt32
221− "uint64" -> pure UInt64
222− "int32" -> pure Int32
223− "int64" -> pure Int64
224− "time" -> pure Time
225− "date" -> pure Date
226− "date-time" -> pure DateTime
227−
228− _ -> fail $
217+ "float" -> pure Float
218+ "double" -> pure Double
219+ "byte" -> pure Byte
220+ "uint32" -> pure UInt32
221+ "uint64" -> pure UInt64
222+ "int32" -> pure Int32
223+ "int64" -> pure Int64
224+ "time" -> pure Time
225+ "date" -> pure Date
226+ "google-datetime" -> pure DateTime
227+ "date-time" -> pure DateTime
228+
229+ _ -> fail $
229230 "Unable to parse Literal from: " ++ Text.unpack t
230231
231232newtype Enm = Enm { _eValues :: [(Text, Help)] }