Skip to content

Commit

Permalink
ToParamSchema instance for SetCookie
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Nov 4, 2018
1 parent 151331d commit 6b73831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Data/Swagger/Internal/ParamSchema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import Data.Version (Version)
import Numeric.Natural.Compat (Natural)
import Data.Word
import Data.UUID.Types (UUID)

import Web.Cookie (SetCookie)
import Data.Swagger.Internal
import Data.Swagger.Lens
import Data.Swagger.SchemaOptions
Expand Down Expand Up @@ -224,6 +224,10 @@ instance ToParamSchema Version where
& type_ .~ SwaggerString
& pattern ?~ "^\\d+(\\.\\d+)*$"

-- Swagger 2.0 doesn't have Cookie support in param schema
instance ToParamSchema SetCookie where
toParamSchema _ = mempty

#if __GLASGOW_HASKELL__ < 800
#else
type family ToParamSchemaByteStringError bs where
Expand Down
1 change: 1 addition & 0 deletions swagger2.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ library
build-depends:
base-compat-batteries >=0.10.4 && <0.11
, aeson >=1.3.1.1 && <1.5
, cookie >=0.4 && <0.5
, generics-sop >=0.3.2.0 && <0.5
, hashable >=1.2.7.0 && <1.3
, http-media >=0.7.1.2 && <0.8
Expand Down

0 comments on commit 6b73831

Please sign in to comment.