@@ -31,6 +31,7 @@ import "unordered-containers" Data.HashSet (HashSet)
3131import Data.Monoid
3232import Data.Set (Set)
3333import Data.Scientific
34+import Data.Fixed (HasResolution(..), Fixed, Pico)
3435import qualified Data.Text as T
3536import qualified Data.Text.Lazy as TL
3637import Data.Time
@@ -159,6 +160,11 @@ instance ToParamSchema Char where
159160instance ToParamSchema Scientific where
160161 toParamSchema _ = mempty & type_ .~ SwaggerNumber
161162
163+instance HasResolution a => ToParamSchema (Fixed a) where
164+ toParamSchema _ = mempty
165+ & type_ .~ SwaggerNumber
166+ & multipleOf ?~ (recip . fromInteger $ resolution (Proxy :: Proxy a))
167+
162168instance ToParamSchema Double where
163169 toParamSchema _ = mempty
164170 & type_ .~ SwaggerNumber
@@ -197,7 +203,7 @@ instance ToParamSchema UTCTime where
197203 toParamSchema _ = timeParamSchema "yyyy-mm-ddThh:MM:ssZ"
198204
199205instance ToParamSchema NominalDiffTime where
200− toParamSchema _ = toParamSchema (Proxy :: Proxy Integer)
206+ toParamSchema _ = toParamSchema (Proxy :: Proxy Pico)
201207
202208instance ToParamSchema T.Text where
203209 toParamSchema _ = toParamSchema (Proxy :: Proxy String)