@@ -29,6 +29,7 @@ import Data.Map (Map)
2929import qualified Data.Map as Map
3030import Data.Monoid
3131import Data.Scientific (Scientific)
32+import Data.Set (Set)
3233import Data.String (IsString(..))
3334import Data.Text (Text)
3435import qualified Data.Text as Text
@@ -99,7 +100,7 @@ data Swagger = Swagger
99100 -- Not all tags that are used by the Operation Object must be declared.
100101 -- The tags that are not declared may be organized randomly or based on the tools' logic.
101102 -- Each tag name in the list MUST be unique.
102− , _swaggerTags :: [Tag]
103+ , _swaggerTags :: Set Tag
103104
104105 -- | Additional external documentation.
105106 , _swaggerExternalDocs :: Maybe ExternalDocs
@@ -221,7 +222,7 @@ data PathItem = PathItem
221222data Operation = Operation
222223 { -- | A list of tags for API documentation control.
223224 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
224− _operationTags :: [TagName]
225+ _operationTags :: Set TagName
225226
226227 -- | A short summary of what the operation does.
227228 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
@@ -697,7 +698,7 @@ data Tag = Tag
697698
698699 -- | Additional external documentation for this tag.
699700 , _tagExternalDocs :: Maybe ExternalDocs
700− } deriving (Eq, Show, Generic, Data, Typeable)
701+ } deriving (Eq, Ord, Show, Generic, Data, Typeable)
701702
702703instance IsString Tag where
703704 fromString s = Tag (fromString s) Nothing Nothing
@@ -710,7 +711,7 @@ data ExternalDocs = ExternalDocs
710711
711712 -- | The URL for the target documentation.
712713 , _externalDocsUrl :: URL
713− } deriving (Eq, Show, Generic, Data, Typeable)
714+ } deriving (Eq, Ord, Show, Generic, Data, Typeable)
714715
715716-- | A simple object to allow referencing other definitions in the specification.
716717-- It can be used to reference parameters and responses that are defined at the top level for reuse.
@@ -725,7 +726,7 @@ data Referenced a
725726instance IsString a => IsString (Referenced a) where
726727 fromString = Inline . fromString
727728
728−newtype URL = URL { getUrl :: Text } deriving (Eq, Show, ToJSON, FromJSON, Data, Typeable)
729+newtype URL = URL { getUrl :: Text } deriving (Eq, Ord, Show, ToJSON, FromJSON, Data, Typeable)
729730
730731-- =======================================================================
731732-- Monoid instances