Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
442 changes: 442 additions & 0 deletions src/Data/HashMap/Strict/InsOrd/Compat.hs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Data/Swagger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import Data.Swagger.Internal
-- $setup
-- >>> import Control.Lens
-- >>> import Data.Aeson
-- >>> import qualified Data.HashMap.Strict.InsOrd as IOHM
-- >>> import qualified Data.HashMap.Strict.InsOrd.Compat as IOHM
-- >>> import Data.Monoid
-- >>> import Data.Proxy
-- >>> import GHC.Generics
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Swagger/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
import Network.HTTP.Media (MediaType)
import Text.Read (readMaybe)

import Data.HashMap.Strict.InsOrd (InsOrdHashMap)
import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import Data.HashMap.Strict.InsOrd.Compat (InsOrdHashMap)
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrdHashMap
import qualified Data.Aeson.Key as K
import qualified Data.Aeson.KeyMap as KM

Expand Down Expand Up @@ -372,7 +372,7 @@
-- @'SwaggerItemsObject'@ should be used to specify homogenous array @'Schema'@s.
--
-- @'SwaggerItemsArray'@ should be used to specify tuple @'Schema'@s.
data SwaggerItems (t :: SwaggerKind *) where

Check warning on line 375 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.8.1, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’

Check warning on line 375 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.10.1, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’

Check warning on line 375 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.6.4, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
SwaggerItemsPrimitive :: Maybe (CollectionFormat k) -> ParamSchema k-> SwaggerItems k
SwaggerItemsObject :: Referenced Schema -> SwaggerItems 'SwaggerKindSchema
SwaggerItemsArray :: [Referenced Schema] -> SwaggerItems 'SwaggerKindSchema
Expand Down Expand Up @@ -430,12 +430,12 @@
dataTypeOf _ = swaggerItemsDataType

-- | Type used as a kind to avoid overlapping instances.
data SwaggerKind (t :: *)

Check warning on line 433 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.8.1, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’

Check warning on line 433 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.10.1, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’

Check warning on line 433 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.6.4, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
= SwaggerKindNormal t
| SwaggerKindParamOtherSchema
| SwaggerKindSchema

type family SwaggerKindType (k :: SwaggerKind *) :: *

Check warning on line 438 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.8.1, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’

Check warning on line 438 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.10.1, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’

Check warning on line 438 in src/Data/Swagger/Internal.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.6.4, 3.12.1.0, ubuntu-latest)

Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
type instance SwaggerKindType ('SwaggerKindNormal t) = t
type instance SwaggerKindType 'SwaggerKindSchema = Schema
type instance SwaggerKindType 'SwaggerKindParamOtherSchema = ParamOtherSchema
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Swagger/Internal/AesonUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import qualified Data.Text as T
import qualified Data.HashMap.Strict as HM
import qualified Data.Set as Set
import qualified Data.HashMap.Strict.InsOrd as InsOrd
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrd
import qualified Data.HashSet.InsOrd as InsOrdHS

-------------------------------------------------------------------------------
Expand Down Expand Up @@ -104,7 +104,7 @@
, HasSwaggerAesonOptions a
, All2 ToJSON (Code a)
, All2 Eq (Code a)
, Code a ~ '[xs]

Check warning on line 107 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 107 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.8.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 107 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.10.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 107 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.6.4, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators
)
=> a
-> Value
Expand All @@ -125,7 +125,7 @@
, HasDatatypeInfo a
, All2 ToJSON (Code a)
, All2 Eq (Code a)
, Code a ~ '[xs]

Check warning on line 128 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 128 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.8.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 128 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.10.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 128 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.6.4, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators
)
=> SwaggerAesonOptions
-> a
Expand Down Expand Up @@ -189,7 +189,7 @@
, HasSwaggerAesonOptions a
, All2 FromJSON (Code a)
, All2 Eq (Code a)
, Code a ~ '[xs]

Check warning on line 192 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 192 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.8.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 192 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.10.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 192 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.6.4, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators
)
=> Value
-> Parser a
Expand Down Expand Up @@ -263,7 +263,7 @@
, HasSwaggerAesonOptions a
, All2 ToJSON (Code a)
, All2 Eq (Code a)
, Code a ~ '[xs]

Check warning on line 266 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 266 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.8.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 266 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.10.1, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 266 in src/Data/Swagger/Internal/AesonUtils.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.6.4, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators
)
=> a
-> Encoding
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Swagger/Internal/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HashMap
import "unordered-containers" Data.HashSet (HashSet)
import qualified "unordered-containers" Data.HashSet as HashSet
import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrdHashMap
import Data.Int
import Data.IntSet (IntSet)
import Data.IntMap (IntMap)
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Swagger/Internal/Schema/Validation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import Data.Foldable (for_, sequenceA_,
traverse_)
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HashMap
import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrdHashMap
import qualified "unordered-containers" Data.HashSet as HashSet
import Data.Proxy
import Data.Scientific (Scientific, isInteger)
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Swagger/Internal/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import Data.Data
import Data.Hashable (Hashable)
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HashMap
import Data.HashMap.Strict.InsOrd (InsOrdHashMap)
import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import Data.HashMap.Strict.InsOrd.Compat (InsOrdHashMap)
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrdHashMap
import Data.Map (Map)
import Data.Set (Set)
import Data.Text (Text)
Expand Down
6 changes: 3 additions & 3 deletions src/Data/Swagger/Operation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ import Data.Swagger.Internal
import Data.Swagger.Lens
import Data.Swagger.Schema

import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import Data.HashMap.Strict.InsOrd (InsOrdHashMap)
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrdHashMap
import Data.HashMap.Strict.InsOrd.Compat (InsOrdHashMap)
import qualified Data.HashSet.InsOrd as InsOrdHS

-- $setup
-- >>> import Data.Aeson
-- >>> import qualified Data.HashMap.Strict.InsOrd as IOHM
-- >>> import qualified Data.HashMap.Strict.InsOrd.Compat as IOHM
-- >>> import Data.Proxy
-- >>> import Data.Time

Expand Down
2 changes: 1 addition & 1 deletion src/Data/Swagger/Optics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-- library.
--
-- >>> import Data.Aeson
-- >>> import qualified Data.HashMap.Strict.InsOrd as IOHM
-- >>> import qualified Data.HashMap.Strict.InsOrd.Compat as IOHM
-- >>> import Optics.Core
-- >>> :set -XOverloadedLabels
--
Expand Down Expand Up @@ -75,7 +75,7 @@

-- Lenses

makeFieldLabels ''Swagger

Check warning on line 78 in src/Data/Swagger/Optics.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 78 in src/Data/Swagger/Optics.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 78 in src/Data/Swagger/Optics.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 78 in src/Data/Swagger/Optics.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators

Check warning on line 78 in src/Data/Swagger/Optics.hs

View workflow job for this annotation

GitHub Actions / build and test (cabal) (9.4.8, 3.12.1.0, ubuntu-latest)

The use of ‘~’ without TypeOperators
makeFieldLabels ''Host
makeFieldLabels ''Info
makeFieldLabels ''Contact
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Swagger/Schema/Generator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Control.Monad (filterM)
import Data.Aeson
import qualified Data.Aeson.KeyMap as KM
import Data.Aeson.Types
import qualified Data.HashMap.Strict.InsOrd as M
import qualified Data.HashMap.Strict.InsOrd.Compat as M
import Data.Maybe
import Data.Proxy
import Data.Scientific
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-19.11
resolver: nightly-2026-04-19
packages:
- "."

7 changes: 4 additions & 3 deletions swagger2.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ custom-setup
library
hs-source-dirs: src
exposed-modules:
Data.HashMap.Strict.InsOrd.Compat
Data.Swagger
Data.Swagger.Declare
Data.Swagger.Lens
Expand Down Expand Up @@ -84,7 +85,7 @@ library
, generics-sop >=0.5.1.0 && <0.6
, hashable >=1.2.7.0 && <1.6
, http-media >=0.8.0.0 && <0.9
, insert-ordered-containers >=0.2.3 && <0.3
, insert-ordered-containers >=0.2.3 && <0.4
, lens >=4.16.1 && <5.4
, network >=2.6.3.5 && <3.3
, optics-core >=0.2 && <0.5
Expand All @@ -93,7 +94,7 @@ library
, unordered-containers >=0.2.9.0 && <0.3
, uuid-types >=1.0.3 && <1.1
, vector >=0.12.0.1 && <0.14
, QuickCheck >=2.10.1 && <2.16
, QuickCheck >=2.10.1 && <2.17

default-language: Haskell2010

Expand Down Expand Up @@ -131,7 +132,7 @@ test-suite spec

-- https://github.com/haskell/cabal/issues/3708
build-tool-depends:
hspec-discover:hspec-discover >=2.5.5 && <2.9
hspec-discover:hspec-discover >=2.5.5 && <2.12

other-modules:
SpecCommon
Expand Down
2 changes: 1 addition & 1 deletion test/Data/Swagger/SchemaSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Prelude.Compat

import Control.Lens ((^.))
import Data.Aeson (Value)
import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrdHashMap
import Data.Proxy
import Data.Set (Set)
import qualified Data.Text as Text
Expand Down
2 changes: 1 addition & 1 deletion test/Data/SwaggerSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Control.Lens
import Data.Aeson
import Data.Aeson.QQ.Simple
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
import qualified Data.HashMap.Strict.InsOrd.Compat as InsOrdHashMap
import qualified Data.HashSet.InsOrd as InsOrdHS
import Data.Text (Text)

Expand Down
Loading