git.iko.soy/typeable/swagger2
on master help sign in
Add TagName type synonym
commit38e2384d0d2a9d419ab1d9e9a43e4c5162b272e5 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateFri 25 Dec 2015, 13:17 (11 years ago) parent3cc860d
2 files changed+7−3
src/Data/Swagger.hs+2−1 src/Data/Swagger/Internal.hs+5−2
src/Data/Swagger.hs+2−1
@@ -38,8 +38,9 @@ module Data.Swagger (
3838 PathItem(..),
3939
4040 -- ** Operations
41− Tag(..),
4241 Operation(..),
42+ Tag(..),
43+ TagName,
4344
4445 -- ** Types and formats
4546 SwaggerType(..),
src/Data/Swagger/Internal.hs+5−2
@@ -211,7 +211,7 @@ data PathItem = PathItem
211211data Operation = Operation
212212 { -- | A list of tags for API documentation control.
213213 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
214− _operationTags :: [Text]
214+ _operationTags :: [TagName]
215215
216216 -- | A short summary of what the operation does.
217217 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
@@ -658,11 +658,14 @@ newtype SecurityRequirement = SecurityRequirement
658658 { getSecurityRequirement :: HashMap Text [Text]
659659 } deriving (Eq, Read, Show, Monoid, ToJSON, FromJSON, Data, Typeable)
660660
661+-- | Tag name.
662+type TagName = Text
663+
661664-- | Allows adding meta data to a single tag that is used by @Operation@.
662665-- It is not mandatory to have a @Tag@ per tag used there.
663666data Tag = Tag
664667 { -- | The name of the tag.
665− _tagName :: Text
668+ _tagName :: TagName
666669
667670 -- | A short description for the tag.
668671 -- GFM syntax can be used for rich text representation.