@@ -18,10 +18,18 @@ module Data.Swagger (
18 -- ** Schema specification
18 -- ** Schema specification
19 -- $schema
19 -- $schema
21 -- * Re-exports
27 -- * Re-exports
22 module Data.Swagger.Lens,
28 module Data.Swagger.Lens,
29+ module Data.Swagger.Operation,
23 module Data.Swagger.ParamSchema,
30 module Data.Swagger.ParamSchema,
24 module Data.Swagger.Schema,
31 module Data.Swagger.Schema,
32+ module Data.Swagger.Schema.Validation,
26 -- * Swagger specification
34 -- * Swagger specification
27 Swagger(..),
35 Swagger(..),
@@ -97,8 +105,10 @@ module Data.Swagger (
99import Data.Swagger.Lens
107import Data.Swagger.Lens
108+import Data.Swagger.Operation
100import Data.Swagger.ParamSchema
109import Data.Swagger.ParamSchema
101import Data.Swagger.Schema
110import Data.Swagger.Schema
111+import Data.Swagger.Schema.Validation
103import Data.Swagger.Internal
113import Data.Swagger.Internal
@@ -214,7 +224,7 @@ import Data.Swagger.Internal
214-- A few other field accessors are modified in this way:
224-- A few other field accessors are modified in this way:
216-- - @'in_'@, @'type_'@, @'default_'@ (as keywords);
226-- - @'in_'@, @'type_'@, @'default_'@ (as keywords);
217−-- - @'maximum_'@ and @'minimum_'@ (as conflicting with @Prelude@);
227+-- - @'maximum_'@, @'minimum_'@, @'head_'@ (as conflicting with @Prelude@);
218-- - @'enum_'@ (as conflicting with @Control.Lens@).
228-- - @'enum_'@ (as conflicting with @Control.Lens@).
220-- $schema
230-- $schema
@@ -257,5 +267,17 @@ import Data.Swagger.Internal
257-- "{\"age\":28,\"name\":\"David\"}"
267-- "{\"age\":28,\"name\":\"David\"}"
258-- >>> encode $ toSchema (Proxy :: Proxy Person)
268-- >>> encode $ toSchema (Proxy :: Proxy Person)
259-- "{\"required\":[\"name\",\"age\"],\"type\":\"object\",\"properties\":{\"age\":{\"type\":\"integer\"},\"name\":{\"type\":\"string\"}}}"
269-- "{\"required\":[\"name\",\"age\"],\"type\":\"object\",\"properties\":{\"age\":{\"type\":\"integer\"},\"name\":{\"type\":\"string\"}}}"
272+-- Sometimes you have to work with an imported or generated @'Swagger'@.
273+-- For instance, <servant-swagger http://hackage.haskell.org/package/servant-swagger> generates basic @'Swagger'@
274+-- for a type-level servant API.
276+-- Lenses and prisms can be used to manipulate such specification to add additional information, tags, extra responses, etc.
277+-- To facilitate common needs, @'Data.Swagger.Operation'@ module provides useful helpers.
280+-- While @'ToParamSchema'@ and @'ToSchema'@ provide means to easily obtain schemas for Haskell types,
281+-- there is no static mechanism to ensure those instances correspond to the @'ToHttpApiData'@ or @'ToJSON'@ instances.
283+-- @'Data.Swagger.Schema.Validation'@ addresses @'ToJSON'@/@'ToSchema'@ validation.