Adjust JSON-Encoding of UploadMode to avoid migration

This commit is contained in:
Gregor Kleen 2019-05-20 15:22:41 +02:00
parent 8152b3b5ca
commit aa7f451a81

View File

@ -250,7 +250,9 @@ defaultExtensionRestriction :: Maybe (NonNull (Set Extension))
defaultExtensionRestriction = fromNullable $ Set.fromList ["txt", "pdf"]
deriveJSON defaultOptions
{ constructorTagModifier = camelToPathPiece
{ constructorTagModifier = \c -> if
| c == "UploadAny" -> "upload"
| otherwise -> camelToPathPiece c
, fieldLabelModifier = camelToPathPiece
, sumEncoding = TaggedObject "mode" "settings"
, omitNothingFields = True