diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+2.1.2.1
+-------
+
+* Bug fix previous release
+
 2.1.2
 ---
 
diff --git a/src/Data/Swagger/Internal/Schema.hs b/src/Data/Swagger/Internal/Schema.hs
--- a/src/Data/Swagger/Internal/Schema.hs
+++ b/src/Data/Swagger/Internal/Schema.hs
@@ -482,7 +482,22 @@
   declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy [(Int, a)])
 
 #if MIN_VERSION_aeson(1,0,0)
+instance (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (Map k v) where
+  declareNamedSchema _ = case toJSONKey :: ToJSONKeyFunction k of
+      ToJSONKeyText  _ _ -> declareObjectMapSchema
+      ToJSONKeyValue _ _ -> declareNamedSchema (Proxy :: Proxy [(k, v)])
+    where
+      declareObjectMapSchema = do
+        schema <- declareSchemaRef (Proxy :: Proxy v)
+        return $ unnamed $ mempty
+          & type_ .~ SwaggerObject
+          & additionalProperties ?~ schema
 
+instance (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (HashMap k v) where
+  declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy (Map k v))
+
+#else
+
 instance ToSchema a => ToSchema (Map String a) where
   declareNamedSchema _ = do
     schema <- declareSchemaRef (Proxy :: Proxy a)
@@ -496,22 +511,6 @@
 instance ToSchema a => ToSchema (HashMap String  a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy (Map String a))
 instance ToSchema a => ToSchema (HashMap T.Text  a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy (Map String a))
 instance ToSchema a => ToSchema (HashMap TL.Text a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy (Map String a))
-
-#else
-
-instance (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (Map k v) where
-  declareNamedSchema _ = case toJSONKey :: ToJSONKeyFunction v of
-    ToJSONKeyText  _ _ -> declareObjectMapSchema
-    ToJSONKeyValue _ _ -> declareNamedSchema (Proxy :: Proxy [(k, v)])
-  where
-    declareObjectMapSchema = do
-      schema <- declareSchemaRef (Proxy :: Proxy v)
-      return $ unnamed $ mempty
-        & type_ .~ SwaggerObject
-        & additionalProperties ?~ schema
-
-instance (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (HashMap k v) where
-  declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy (Map k v))
 
 #endif
 
diff --git a/swagger2.cabal b/swagger2.cabal
--- a/swagger2.cabal
+++ b/swagger2.cabal
@@ -1,5 +1,5 @@
 name:                swagger2
-version:             2.1.2
+version:             2.1.2.1
 synopsis:            Swagger 2.0 data model
 description:         Please see README.md
 homepage:            https://github.com/GetShopTV/swagger2
