@@ -29,13 +29,14 @@ import Control.Applicative
2929import Data.Aeson
3030import qualified Data.Aeson.Types as JSON
3131import Data.Data (Data(..), Typeable, mkConstr, mkDataType, Fixity(..), Constr, DataType, constrIndex)
32+import Data.Hashable (Hashable)
3233import qualified Data.HashMap.Strict as HashMap
34+import Data.HashSet.InsOrd (InsOrdHashSet)
3335import Data.Map (Map)
3436import qualified Data.Map as Map
3537import Data.Monoid (Monoid (..))
3638import Data.Semigroup.Compat (Semigroup (..))
3739import Data.Scientific (Scientific)
38−import Data.Set (Set)
3940import Data.String (IsString(..))
4041import Data.Text (Text)
4142import qualified Data.Text as Text
@@ -129,7 +130,7 @@ data Swagger = Swagger
129130 -- Not all tags that are used by the Operation Object must be declared.
130131 -- The tags that are not declared may be organized randomly or based on the tools' logic.
131132 -- Each tag name in the list MUST be unique.
132− , _swaggerTags :: Set Tag
133+ , _swaggerTags :: InsOrdHashSet Tag
133134
134135 -- | Additional external documentation.
135136 , _swaggerExternalDocs :: Maybe ExternalDocs
@@ -251,7 +252,7 @@ data PathItem = PathItem
251252data Operation = Operation
252253 { -- | A list of tags for API documentation control.
253254 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
254− _operationTags :: Set TagName
255+ _operationTags :: InsOrdHashSet TagName
255256
256257 -- | A short summary of what the operation does.
257258 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
@@ -778,6 +779,8 @@ data Tag = Tag
778779 , _tagExternalDocs :: Maybe ExternalDocs
779780 } deriving (Eq, Ord, Show, Generic, Data, Typeable)
780781
782+instance Hashable Tag
783+
781784instance IsString Tag where
782785 fromString s = Tag (fromString s) Nothing Nothing
783786
@@ -791,6 +794,8 @@ data ExternalDocs = ExternalDocs
791794 , _externalDocsUrl :: URL
792795 } deriving (Eq, Ord, Show, Generic, Data, Typeable)
793796
797+instance Hashable ExternalDocs
798+
794799-- | A simple object to allow referencing other definitions in the specification.
795800-- It can be used to reference parameters and responses that are defined at the top level for reuse.
796801newtype Reference = Reference { getReference :: Text }
@@ -804,7 +809,7 @@ data Referenced a
804809instance IsString a => IsString (Referenced a) where
805810 fromString = Inline . fromString
806811
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)
808813
809814data AdditionalProperties
810815 = AdditionalPropertiesAllowed Bool
@@ -913,6 +918,7 @@ instance SwaggerMonoid Responses
913918instance SwaggerMonoid Response
914919instance SwaggerMonoid ExternalDocs
915920instance SwaggerMonoid Operation
921+instance (Eq a, Hashable a) => SwaggerMonoid (InsOrdHashSet a)
916922
917923instance SwaggerMonoid MimeList
918924deriving instance SwaggerMonoid URL