git.iko.soy/typeable/swagger2
on master help sign in
Add TagName type synonym
38e2384Nickolay Kudasov
src/Data/Swagger.hs+2−1
@@ -38,8 +38,9 @@ module Data.Swagger (
38 PathItem(..),
38 PathItem(..),
39
39
40 -- ** Operations
40 -- ** Operations
41− Tag(..),
42 Operation(..),
41 Operation(..),
42+ Tag(..),
43+ TagName,
43
44
44 -- ** Types and formats
45 -- ** Types and formats
45 SwaggerType(..),
46 SwaggerType(..),
src/Data/Swagger/Internal.hs+5−2
@@ -211,7 +211,7 @@ data PathItem = PathItem
211data Operation = Operation
211data Operation = Operation
212 { -- | A list of tags for API documentation control.
212 { -- | A list of tags for API documentation control.
213 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
213 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
214− _operationTags :: [Text]
214+ _operationTags :: [TagName]
215
215
216 -- | A short summary of what the operation does.
216 -- | A short summary of what the operation does.
217 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
217 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
@@ -658,11 +658,14 @@ newtype SecurityRequirement = SecurityRequirement
658 { getSecurityRequirement :: HashMap Text [Text]
658 { getSecurityRequirement :: HashMap Text [Text]
659 } deriving (Eq, Read, Show, Monoid, ToJSON, FromJSON, Data, Typeable)
659 } deriving (Eq, Read, Show, Monoid, ToJSON, FromJSON, Data, Typeable)
660
660
661+-- | Tag name.
662+type TagName = Text
663+
661-- | Allows adding meta data to a single tag that is used by @Operation@.
664-- | Allows adding meta data to a single tag that is used by @Operation@.
662-- It is not mandatory to have a @Tag@ per tag used there.
665-- It is not mandatory to have a @Tag@ per tag used there.
663data Tag = Tag
666data Tag = Tag
664 { -- | The name of the tag.
667 { -- | The name of the tag.
665− _tagName :: Text
668+ _tagName :: TagName
666
669
667 -- | A short description for the tag.
670 -- | A short description for the tag.
668 -- GFM syntax can be used for rich text representation.
671 -- GFM syntax can be used for rich text representation.