@@ -29,13 +29,14 @@ import Control.Applicative
29import Data.Aeson
29import Data.Aeson
30import qualified Data.Aeson.Types as JSON
30import qualified Data.Aeson.Types as JSON
31import Data.Data (Data(..), Typeable, mkConstr, mkDataType, Fixity(..), Constr, DataType, constrIndex)
31import Data.Data (Data(..), Typeable, mkConstr, mkDataType, Fixity(..), Constr, DataType, constrIndex)
32+import Data.Hashable (Hashable)
32import qualified Data.HashMap.Strict as HashMap
33import qualified Data.HashMap.Strict as HashMap
34+import Data.HashSet.InsOrd (InsOrdHashSet)
33import Data.Map (Map)
35import Data.Map (Map)
34import qualified Data.Map as Map
36import qualified Data.Map as Map
35import Data.Monoid (Monoid (..))
37import Data.Monoid (Monoid (..))
36import Data.Semigroup.Compat (Semigroup (..))
38import Data.Semigroup.Compat (Semigroup (..))
37import Data.Scientific (Scientific)
39import Data.Scientific (Scientific)
39import Data.String (IsString(..))
40import Data.String (IsString(..))
40import Data.Text (Text)
41import Data.Text (Text)
41import qualified Data.Text as Text
42import qualified Data.Text as Text
@@ -129,7 +130,7 @@ data Swagger = Swagger
129 -- Not all tags that are used by the Operation Object must be declared.
130 -- Not all tags that are used by the Operation Object must be declared.
130 -- The tags that are not declared may be organized randomly or based on the tools' logic.
131 -- The tags that are not declared may be organized randomly or based on the tools' logic.
131 -- Each tag name in the list MUST be unique.
132 -- Each tag name in the list MUST be unique.
132− , _swaggerTags :: Set Tag
133+ , _swaggerTags :: InsOrdHashSet Tag
134 -- | Additional external documentation.
135 -- | Additional external documentation.
135 , _swaggerExternalDocs :: Maybe ExternalDocs
136 , _swaggerExternalDocs :: Maybe ExternalDocs
@@ -251,7 +252,7 @@ data PathItem = PathItem
251data Operation = Operation
252data Operation = Operation
252 { -- | A list of tags for API documentation control.
253 { -- | A list of tags for API documentation control.
253 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
254 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
254− _operationTags :: Set TagName
255+ _operationTags :: InsOrdHashSet TagName
256 -- | A short summary of what the operation does.
257 -- | A short summary of what the operation does.
257 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
258 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
@@ -778,6 +779,8 @@ data Tag = Tag
778 , _tagExternalDocs :: Maybe ExternalDocs
779 , _tagExternalDocs :: Maybe ExternalDocs
779 } deriving (Eq, Ord, Show, Generic, Data, Typeable)
780 } deriving (Eq, Ord, Show, Generic, Data, Typeable)
782+instance Hashable Tag
781instance IsString Tag where
784instance IsString Tag where
782 fromString s = Tag (fromString s) Nothing Nothing
785 fromString s = Tag (fromString s) Nothing Nothing
@@ -791,6 +794,8 @@ data ExternalDocs = ExternalDocs
791 , _externalDocsUrl :: URL
794 , _externalDocsUrl :: URL
792 } deriving (Eq, Ord, Show, Generic, Data, Typeable)
795 } deriving (Eq, Ord, Show, Generic, Data, Typeable)
797+instance Hashable ExternalDocs
794-- | A simple object to allow referencing other definitions in the specification.
799-- | A simple object to allow referencing other definitions in the specification.
795-- It can be used to reference parameters and responses that are defined at the top level for reuse.
800-- It can be used to reference parameters and responses that are defined at the top level for reuse.
796newtype Reference = Reference { getReference :: Text }
801newtype Reference = Reference { getReference :: Text }
@@ -804,7 +809,7 @@ data Referenced a
804instance IsString a => IsString (Referenced a) where
809instance IsString a => IsString (Referenced a) where
805 fromString = Inline . fromString
810 fromString = Inline . fromString
807−newtype URL = URL { getUrl :: Text } deriving (Eq, Ord, Show, ToJSON, FromJSON, Data, Typeable)
812+newtype URL = URL { getUrl :: Text } deriving (Eq, Ord, Show, Hashable, ToJSON, FromJSON, Data, Typeable)
809data AdditionalProperties
814data AdditionalProperties
810 = AdditionalPropertiesAllowed Bool
815 = AdditionalPropertiesAllowed Bool
@@ -913,6 +918,7 @@ instance SwaggerMonoid Responses
913instance SwaggerMonoid Response
918instance SwaggerMonoid Response
914instance SwaggerMonoid ExternalDocs
919instance SwaggerMonoid ExternalDocs
915instance SwaggerMonoid Operation
920instance SwaggerMonoid Operation
921+instance (Eq a, Hashable a) => SwaggerMonoid (InsOrdHashSet a)
917instance SwaggerMonoid MimeList
923instance SwaggerMonoid MimeList
918deriving instance SwaggerMonoid URL
924deriving instance SwaggerMonoid URL