@@ -29,6 +29,7 @@ import Data.Map (Map)
29import qualified Data.Map as Map
29import qualified Data.Map as Map
30import Data.Monoid
30import Data.Monoid
31import Data.Scientific (Scientific)
31import Data.Scientific (Scientific)
32import Data.String (IsString(..))
33import Data.String (IsString(..))
33import Data.Text (Text)
34import Data.Text (Text)
34import qualified Data.Text as Text
35import qualified Data.Text as Text
@@ -99,7 +100,7 @@ data Swagger = Swagger
99 -- Not all tags that are used by the Operation Object must be declared.
100 -- Not all tags that are used by the Operation Object must be declared.
100 -- The tags that are not declared may be organized randomly or based on the tools' logic.
101 -- The tags that are not declared may be organized randomly or based on the tools' logic.
101 -- Each tag name in the list MUST be unique.
102 -- Each tag name in the list MUST be unique.
102− , _swaggerTags :: [Tag]
103+ , _swaggerTags :: Set Tag
104 -- | Additional external documentation.
105 -- | Additional external documentation.
105 , _swaggerExternalDocs :: Maybe ExternalDocs
106 , _swaggerExternalDocs :: Maybe ExternalDocs
@@ -221,7 +222,7 @@ data PathItem = PathItem
221data Operation = Operation
222data Operation = Operation
222 { -- | A list of tags for API documentation control.
223 { -- | A list of tags for API documentation control.
223 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
224 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
224− _operationTags :: [TagName]
225+ _operationTags :: Set TagName
226 -- | A short summary of what the operation does.
227 -- | A short summary of what the operation does.
227 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
228 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
@@ -697,7 +698,7 @@ data Tag = Tag
698 -- | Additional external documentation for this tag.
699 -- | Additional external documentation for this tag.
699 , _tagExternalDocs :: Maybe ExternalDocs
700 , _tagExternalDocs :: Maybe ExternalDocs
700− } deriving (Eq, Show, Generic, Data, Typeable)
701+ } deriving (Eq, Ord, Show, Generic, Data, Typeable)
702instance IsString Tag where
703instance IsString Tag where
703 fromString s = Tag (fromString s) Nothing Nothing
704 fromString s = Tag (fromString s) Nothing Nothing
@@ -710,7 +711,7 @@ data ExternalDocs = ExternalDocs
711 -- | The URL for the target documentation.
712 -- | The URL for the target documentation.
712 , _externalDocsUrl :: URL
713 , _externalDocsUrl :: URL
713− } deriving (Eq, Show, Generic, Data, Typeable)
714+ } deriving (Eq, Ord, Show, Generic, Data, Typeable)
715-- | A simple object to allow referencing other definitions in the specification.
716-- | A simple object to allow referencing other definitions in the specification.
716-- It can be used to reference parameters and responses that are defined at the top level for reuse.
717-- 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
725instance IsString a => IsString (Referenced a) where
726instance IsString a => IsString (Referenced a) where
726 fromString = Inline . fromString
727 fromString = Inline . fromString
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)
730-- =======================================================================
731-- =======================================================================
731-- Monoid instances
732-- Monoid instances