git.iko.soy/typeable/openapi3
on master help sign in
Add models for Contact and License objects
a3e83f1Nickolay Kudasov
src/Data/Swagger/Internal.hs+18−2
@@ -3,6 +3,7 @@ module Data.Swagger.Internal where
3import Data.Text (Text)
3import Data.Text (Text)
4import Network (HostName, PortNumber)
4import Network (HostName, PortNumber)
5import Network.HTTP.Media (MediaType)
5import Network.HTTP.Media (MediaType)
6+import Network.URL (URL)
6
7
7-- | This is the root document object for the API specification.
8-- | This is the root document object for the API specification.
8data Swagger = Swagger
9data Swagger = Swagger
@@ -90,11 +91,26 @@ data SwaggerInfo = SwaggerInfo
90 , swaggerInfoVersion :: Text
91 , swaggerInfoVersion :: Text
91 } deriving (Show)
92 } deriving (Show)
92
93
94+-- | Contact information for the exposed API.
93data SwaggerContact = SwaggerContact
95data SwaggerContact = SwaggerContact
96+ { -- | The identifying name of the contact person/organization.
97+ swaggerContactName :: Maybe Text
98+
99+ -- | The URL pointing to the contact information.
100+ , swaggerContactURL :: Maybe URL
101+
102+ -- | The email address of the contact person/organization.
103+ , swaggerContactEmail :: Maybe Text
94− deriving (Show)
104+ } deriving (Show)
95
105
106+-- | License information for the exposed API.
96data SwaggerLicense = SwaggerLicense
107data SwaggerLicense = SwaggerLicense
108+ { -- | The license name used for the API.
109+ swaggerLicenseName :: Text
110+
111+ -- | A URL to the license used for the API.
112+ , swaggerLicenseURL :: Maybe URL
97− deriving (Show)
113+ } deriving (Show)
98
114
99-- | The host (name or ip) serving the API. It MAY include a port.
115-- | The host (name or ip) serving the API. It MAY include a port.
100data SwaggerHost = SwaggerHost
116data SwaggerHost = SwaggerHost
swagger2.cabal+1
@@ -24,6 +24,7 @@ library
24 , http-media
24 , http-media
25 , network
25 , network
26 , text
26 , text
27+ , url
27 default-language: Haskell2010
28 default-language: Haskell2010
28
29
29source-repository head
30source-repository head