git.iko.soy/typeable/openapi3
on master help sign in
Merge pull request #2 from GetShopTV/swagger-lens
75fed15Nickolay Kudasov
src/Data/Swagger/Internal.hs+127−127
@@ -35,61 +35,61 @@ import Data.Swagger.Internal.Utils
35data Swagger = Swagger
35data Swagger = Swagger
36 { -- | Provides metadata about the API.
36 { -- | Provides metadata about the API.
37 -- The metadata can be used by the clients if needed.
37 -- The metadata can be used by the clients if needed.
38− swaggerInfo :: SwaggerInfo
38+ _swaggerInfo :: SwaggerInfo
39
39
40 -- | The host (name or ip) serving the API. It MAY include a port.
40 -- | The host (name or ip) serving the API. It MAY include a port.
41 -- If the host is not included, the host serving the documentation is to be used (including the port).
41 -- If the host is not included, the host serving the documentation is to be used (including the port).
42− , swaggerHost :: Maybe SwaggerHost
42+ , _swaggerHost :: Maybe SwaggerHost
43
43
44 -- | The base path on which the API is served, which is relative to the host.
44 -- | The base path on which the API is served, which is relative to the host.
45 -- If it is not included, the API is served directly under the host.
45 -- If it is not included, the API is served directly under the host.
46 -- The value MUST start with a leading slash (/).
46 -- The value MUST start with a leading slash (/).
47− , swaggerBasePath :: Maybe FilePath
47+ , _swaggerBasePath :: Maybe FilePath
48
48
49 -- | The transfer protocol of the API.
49 -- | The transfer protocol of the API.
50 -- If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.
50 -- If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.
51− , swaggerSchemes :: Maybe [SwaggerScheme]
51+ , _swaggerSchemes :: Maybe [SwaggerScheme]
52
52
53 -- | A list of MIME types the APIs can consume.
53 -- | A list of MIME types the APIs can consume.
54 -- This is global to all APIs but can be overridden on specific API calls.
54 -- This is global to all APIs but can be overridden on specific API calls.
55− , swaggerConsumes :: SwaggerMimeList
55+ , _swaggerConsumes :: SwaggerMimeList
56
56
57 -- | A list of MIME types the APIs can produce.
57 -- | A list of MIME types the APIs can produce.
58 -- This is global to all APIs but can be overridden on specific API calls.
58 -- This is global to all APIs but can be overridden on specific API calls.
59− , swaggerProduces :: SwaggerMimeList
59+ , _swaggerProduces :: SwaggerMimeList
60
60
61 -- | The available paths and operations for the API.
61 -- | The available paths and operations for the API.
62− , swaggerPaths :: SwaggerPaths
62+ , _swaggerPaths :: SwaggerPaths
63
63
64 -- | An object to hold data types produced and consumed by operations.
64 -- | An object to hold data types produced and consumed by operations.
65− , swaggerDefinitions :: HashMap Text SwaggerSchema
65+ , _swaggerDefinitions :: HashMap Text SwaggerSchema
66
66
67 -- | An object to hold parameters that can be used across operations.
67 -- | An object to hold parameters that can be used across operations.
68 -- This property does not define global parameters for all operations.
68 -- This property does not define global parameters for all operations.
69− , swaggerParameters :: HashMap Text SwaggerParameter
69+ , _swaggerParameters :: HashMap Text SwaggerParameter
70
70
71 -- | An object to hold responses that can be used across operations.
71 -- | An object to hold responses that can be used across operations.
72 -- This property does not define global responses for all operations.
72 -- This property does not define global responses for all operations.
73− , swaggerResponses :: HashMap Text SwaggerResponse
73+ , _swaggerResponses :: HashMap Text SwaggerResponse
74
74
75 -- | Security scheme definitions that can be used across the specification.
75 -- | Security scheme definitions that can be used across the specification.
76− , swaggerSecurityDefinitions :: HashMap Text SwaggerSecurityScheme
76+ , _swaggerSecurityDefinitions :: HashMap Text SwaggerSecurityScheme
77
77
78 -- | A declaration of which security schemes are applied for the API as a whole.
78 -- | A declaration of which security schemes are applied for the API as a whole.
79 -- The list of values describes alternative security schemes that can be used
79 -- The list of values describes alternative security schemes that can be used
80 -- (that is, there is a logical OR between the security requirements).
80 -- (that is, there is a logical OR between the security requirements).
81 -- Individual operations can override this definition.
81 -- Individual operations can override this definition.
82− , swaggerSecurity :: [SwaggerSecurityRequirement]
82+ , _swaggerSecurity :: [SwaggerSecurityRequirement]
83
83
84 -- | A list of tags used by the specification with additional metadata.
84 -- | A list of tags used by the specification with additional metadata.
85 -- The order of the tags can be used to reflect on their order by the parsing tools.
85 -- The order of the tags can be used to reflect on their order by the parsing tools.
86 -- Not all tags that are used by the Operation Object must be declared.
86 -- Not all tags that are used by the Operation Object must be declared.
87 -- The tags that are not declared may be organized randomly or based on the tools' logic.
87 -- The tags that are not declared may be organized randomly or based on the tools' logic.
88 -- Each tag name in the list MUST be unique.
88 -- Each tag name in the list MUST be unique.
89− , swaggerTags :: [SwaggerTag]
89+ , _swaggerTags :: [SwaggerTag]
90
90
91 -- | Additional external documentation.
91 -- | Additional external documentation.
92− , swaggerExternalDocs :: Maybe SwaggerExternalDocs
92+ , _swaggerExternalDocs :: Maybe SwaggerExternalDocs
93 } deriving (Eq, Show, Generic)
93 } deriving (Eq, Show, Generic)
94
94
95-- | The object provides metadata about the API.
95-- | The object provides metadata about the API.
@@ -97,51 +97,51 @@ data Swagger = Swagger
97-- and can be presented in the Swagger-UI for convenience.
97-- and can be presented in the Swagger-UI for convenience.
98data SwaggerInfo = SwaggerInfo
98data SwaggerInfo = SwaggerInfo
99 { -- | The title of the application.
99 { -- | The title of the application.
100− swaggerInfoTitle :: Text
100+ _swaggerInfoTitle :: Text
101
101
102 -- | A short description of the application.
102 -- | A short description of the application.
103 -- GFM syntax can be used for rich text representation.
103 -- GFM syntax can be used for rich text representation.
104− , swaggerInfoDescription :: Maybe Text
104+ , _swaggerInfoDescription :: Maybe Text
105
105
106 -- | The Terms of Service for the API.
106 -- | The Terms of Service for the API.
107− , swaggerInfoTermsOfService :: Maybe Text
107+ , _swaggerInfoTermsOfService :: Maybe Text
108
108
109 -- | The contact information for the exposed API.
109 -- | The contact information for the exposed API.
110− , swaggerInfoContact :: Maybe SwaggerContact
110+ , _swaggerInfoContact :: Maybe SwaggerContact
111
111
112 -- | The license information for the exposed API.
112 -- | The license information for the exposed API.
113− , swaggerInfoLicense :: Maybe SwaggerLicense
113+ , _swaggerInfoLicense :: Maybe SwaggerLicense
114
114
115 -- | Provides the version of the application API
115 -- | Provides the version of the application API
116 -- (not to be confused with the specification version).
116 -- (not to be confused with the specification version).
117− , swaggerInfoVersion :: Text
117+ , _swaggerInfoVersion :: Text
118 } deriving (Eq, Show, Generic)
118 } deriving (Eq, Show, Generic)
119
119
120-- | Contact information for the exposed API.
120-- | Contact information for the exposed API.
121data SwaggerContact = SwaggerContact
121data SwaggerContact = SwaggerContact
122 { -- | The identifying name of the contact person/organization.
122 { -- | The identifying name of the contact person/organization.
123− swaggerContactName :: Maybe Text
123+ _swaggerContactName :: Maybe Text
124
124
125 -- | The URL pointing to the contact information.
125 -- | The URL pointing to the contact information.
126− , swaggerContactUrl :: Maybe URL
126+ , _swaggerContactUrl :: Maybe URL
127
127
128 -- | The email address of the contact person/organization.
128 -- | The email address of the contact person/organization.
129− , swaggerContactEmail :: Maybe Text
129+ , _swaggerContactEmail :: Maybe Text
130 } deriving (Eq, Show)
130 } deriving (Eq, Show)
131
131
132-- | License information for the exposed API.
132-- | License information for the exposed API.
133data SwaggerLicense = SwaggerLicense
133data SwaggerLicense = SwaggerLicense
134 { -- | The license name used for the API.
134 { -- | The license name used for the API.
135− swaggerLicenseName :: Text
135+ _swaggerLicenseName :: Text
136
136
137 -- | A URL to the license used for the API.
137 -- | A URL to the license used for the API.
138− , swaggerLicenseUrl :: Maybe URL
138+ , _swaggerLicenseUrl :: Maybe URL
139 } deriving (Eq, Show)
139 } deriving (Eq, Show)
140
140
141-- | The host (name or ip) serving the API. It MAY include a port.
141-- | The host (name or ip) serving the API. It MAY include a port.
142data SwaggerHost = SwaggerHost
142data SwaggerHost = SwaggerHost
143− { swaggerHostName :: HostName -- ^ Host name.
143+ { _swaggerHostName :: HostName -- ^ Host name.
144− , swaggerHostPort :: Maybe PortNumber -- ^ Optional port.
144+ , _swaggerHostPort :: Maybe PortNumber -- ^ Optional port.
145 } deriving (Eq, Show)
145 } deriving (Eq, Show)
146
146
147-- | The transfer protocol of the API.
147-- | The transfer protocol of the API.
@@ -156,7 +156,7 @@ data SwaggerScheme
156data SwaggerPaths = SwaggerPaths
156data SwaggerPaths = SwaggerPaths
157 { -- | Holds the relative paths to the individual endpoints.
157 { -- | Holds the relative paths to the individual endpoints.
158 -- The path is appended to the @'swaggerBasePath'@ in order to construct the full URL.
158 -- The path is appended to the @'swaggerBasePath'@ in order to construct the full URL.
159− swaggerPathsMap :: HashMap FilePath SwaggerPathItem
159+ _swaggerPathsMap :: HashMap FilePath SwaggerPathItem
160 } deriving (Eq, Show, Generic)
160 } deriving (Eq, Show, Generic)
161
161
162-- | Describes the operations available on a single path.
162-- | Describes the operations available on a single path.
@@ -165,91 +165,91 @@ data SwaggerPaths = SwaggerPaths
165-- but they will not know which operations and parameters are available.
165-- but they will not know which operations and parameters are available.
166data SwaggerPathItem = SwaggerPathItem
166data SwaggerPathItem = SwaggerPathItem
167 { -- | A definition of a GET operation on this path.
167 { -- | A definition of a GET operation on this path.
168− swaggerPathItemGet :: Maybe SwaggerOperation
168+ _swaggerPathItemGet :: Maybe SwaggerOperation
169
169
170 -- | A definition of a PUT operation on this path.
170 -- | A definition of a PUT operation on this path.
171− , swaggerPathItemPut :: Maybe SwaggerOperation
171+ , _swaggerPathItemPut :: Maybe SwaggerOperation
172
172
173 -- | A definition of a POST operation on this path.
173 -- | A definition of a POST operation on this path.
174− , swaggerPathItemPost :: Maybe SwaggerOperation
174+ , _swaggerPathItemPost :: Maybe SwaggerOperation
175
175
176 -- | A definition of a DELETE operation on this path.
176 -- | A definition of a DELETE operation on this path.
177− , swaggerPathItemDelete :: Maybe SwaggerOperation
177+ , _swaggerPathItemDelete :: Maybe SwaggerOperation
178
178
179 -- | A definition of a OPTIONS operation on this path.
179 -- | A definition of a OPTIONS operation on this path.
180− , swaggerPathItemOptions :: Maybe SwaggerOperation
180+ , _swaggerPathItemOptions :: Maybe SwaggerOperation
181
181
182 -- | A definition of a HEAD operation on this path.
182 -- | A definition of a HEAD operation on this path.
183− , swaggerPathItemHead :: Maybe SwaggerOperation
183+ , _swaggerPathItemHead :: Maybe SwaggerOperation
184
184
185 -- | A definition of a PATCH operation on this path.
185 -- | A definition of a PATCH operation on this path.
186− , swaggerPathItemPatch :: Maybe SwaggerOperation
186+ , _swaggerPathItemPatch :: Maybe SwaggerOperation
187
187
188 -- | A list of parameters that are applicable for all the operations described under this path.
188 -- | A list of parameters that are applicable for all the operations described under this path.
189 -- These parameters can be overridden at the operation level, but cannot be removed there.
189 -- These parameters can be overridden at the operation level, but cannot be removed there.
190 -- The list MUST NOT include duplicated parameters.
190 -- The list MUST NOT include duplicated parameters.
191 -- A unique parameter is defined by a combination of a name and location.
191 -- A unique parameter is defined by a combination of a name and location.
192− , swaggerPathItemParameters :: [SwaggerReferenced SwaggerParameter]
192+ , _swaggerPathItemParameters :: [SwaggerReferenced SwaggerParameter]
193 } deriving (Eq, Show, Generic)
193 } deriving (Eq, Show, Generic)
194
194
195-- | Describes a single API operation on a path.
195-- | Describes a single API operation on a path.
196data SwaggerOperation = SwaggerOperation
196data SwaggerOperation = SwaggerOperation
197 { -- | A list of tags for API documentation control.
197 { -- | A list of tags for API documentation control.
198 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
198 -- Tags can be used for logical grouping of operations by resources or any other qualifier.
199− swaggerOperationTags :: [Text]
199+ _swaggerOperationTags :: [Text]
200
200
201 -- | A short summary of what the operation does.
201 -- | A short summary of what the operation does.
202 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
202 -- For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
203− , swaggerOperationSummary :: Maybe Text
203+ , _swaggerOperationSummary :: Maybe Text
204
204
205 -- | A verbose explanation of the operation behavior.
205 -- | A verbose explanation of the operation behavior.
206 -- GFM syntax can be used for rich text representation.
206 -- GFM syntax can be used for rich text representation.
207− , swaggerOperationDescription :: Maybe Text
207+ , _swaggerOperationDescription :: Maybe Text
208
208
209 -- | Additional external documentation for this operation.
209 -- | Additional external documentation for this operation.
210− , swaggerOperationExternalDocs :: Maybe SwaggerExternalDocs
210+ , _swaggerOperationExternalDocs :: Maybe SwaggerExternalDocs
211
211
212 -- | Unique string used to identify the operation.
212 -- | Unique string used to identify the operation.
213 -- The id MUST be unique among all operations described in the API.
213 -- The id MUST be unique among all operations described in the API.
214 -- Tools and libraries MAY use the it to uniquely identify an operation,
214 -- Tools and libraries MAY use the it to uniquely identify an operation,
215 -- therefore, it is recommended to follow common programming naming conventions.
215 -- therefore, it is recommended to follow common programming naming conventions.
216− , swaggerOperationOperationId :: Maybe Text
216+ , _swaggerOperationOperationId :: Maybe Text
217
217
218 -- | A list of MIME types the operation can consume.
218 -- | A list of MIME types the operation can consume.
219 -- This overrides the @'swaggerConsumes'@.
219 -- This overrides the @'swaggerConsumes'@.
220 -- @Just []@ MAY be used to clear the global definition.
220 -- @Just []@ MAY be used to clear the global definition.
221− , swaggerOperationConsumes :: Maybe SwaggerMimeList
221+ , _swaggerOperationConsumes :: Maybe SwaggerMimeList
222
222
223 -- | A list of MIME types the operation can produce.
223 -- | A list of MIME types the operation can produce.
224 -- This overrides the @'swaggerProduces'@.
224 -- This overrides the @'swaggerProduces'@.
225 -- @Just []@ MAY be used to clear the global definition.
225 -- @Just []@ MAY be used to clear the global definition.
226− , swaggerOperationProduces :: Maybe SwaggerMimeList
226+ , _swaggerOperationProduces :: Maybe SwaggerMimeList
227
227
228 -- | A list of parameters that are applicable for this operation.
228 -- | A list of parameters that are applicable for this operation.
229 -- If a parameter is already defined at the @'SwaggerPathItem'@,
229 -- If a parameter is already defined at the @'SwaggerPathItem'@,
230 -- the new definition will override it, but can never remove it.
230 -- the new definition will override it, but can never remove it.
231 -- The list MUST NOT include duplicated parameters.
231 -- The list MUST NOT include duplicated parameters.
232 -- A unique parameter is defined by a combination of a name and location.
232 -- A unique parameter is defined by a combination of a name and location.
233− , swaggerOperationParameters :: [SwaggerReferenced SwaggerParameter]
233+ , _swaggerOperationParameters :: [SwaggerReferenced SwaggerParameter]
234
234
235 -- | The list of possible responses as they are returned from executing this operation.
235 -- | The list of possible responses as they are returned from executing this operation.
236− , swaggerOperationResponses :: SwaggerResponses
236+ , _swaggerOperationResponses :: SwaggerResponses
237
237
238 -- | The transfer protocol for the operation.
238 -- | The transfer protocol for the operation.
239 -- The value overrides @'swaggerSchemes'@.
239 -- The value overrides @'swaggerSchemes'@.
240− , swaggerOperationSchemes :: Maybe [SwaggerScheme]
240+ , _swaggerOperationSchemes :: Maybe [SwaggerScheme]
241
241
242 -- | Declares this operation to be deprecated.
242 -- | Declares this operation to be deprecated.
243 -- Usage of the declared operation should be refrained.
243 -- Usage of the declared operation should be refrained.
244 -- Default value is @False@.
244 -- Default value is @False@.
245− , swaggerOperationDeprecated :: Bool
245+ , _swaggerOperationDeprecated :: Bool
246
246
247 -- | A declaration of which security schemes are applied for this operation.
247 -- | A declaration of which security schemes are applied for this operation.
248 -- The list of values describes alternative security schemes that can be used
248 -- The list of values describes alternative security schemes that can be used
249 -- (that is, there is a logical OR between the security requirements).
249 -- (that is, there is a logical OR between the security requirements).
250 -- This definition overrides any declared top-level security.
250 -- This definition overrides any declared top-level security.
251 -- To remove a top-level security declaration, @Just []@ can be used.
251 -- To remove a top-level security declaration, @Just []@ can be used.
252− , swaggerOperationSecurity :: [SwaggerSecurityRequirement]
252+ , _swaggerOperationSecurity :: [SwaggerSecurityRequirement]
253 } deriving (Eq, Show, Generic)
253 } deriving (Eq, Show, Generic)
254
254
255newtype SwaggerMimeList = SwaggerMimeList { getSwaggerMimeList :: [MediaType] }
255newtype SwaggerMimeList = SwaggerMimeList { getSwaggerMimeList :: [MediaType] }
@@ -260,20 +260,20 @@ newtype SwaggerMimeList = SwaggerMimeList { getSwaggerMimeList :: [MediaType] }
260data SwaggerParameter = SwaggerParameter
260data SwaggerParameter = SwaggerParameter
261 { -- | The name of the parameter.
261 { -- | The name of the parameter.
262 -- Parameter names are case sensitive.
262 -- Parameter names are case sensitive.
263− swaggerParameterName :: Text
263+ _swaggerParameterName :: Text
264
264
265 -- | A brief description of the parameter.
265 -- | A brief description of the parameter.
266 -- This could contain examples of use.
266 -- This could contain examples of use.
267 -- GFM syntax can be used for rich text representation.
267 -- GFM syntax can be used for rich text representation.
268− , swaggerParameterDescription :: Maybe Text
268+ , _swaggerParameterDescription :: Maybe Text
269
269
270 -- | Determines whether this parameter is mandatory.
270 -- | Determines whether this parameter is mandatory.
271 -- If the parameter is in "path", this property is required and its value MUST be true.
271 -- If the parameter is in "path", this property is required and its value MUST be true.
272 -- Otherwise, the property MAY be included and its default value is @False@.
272 -- Otherwise, the property MAY be included and its default value is @False@.
273− , swaggerParameterRequired :: Bool
273+ , _swaggerParameterRequired :: Bool
274
274
275 -- | Parameter schema.
275 -- | Parameter schema.
276− , swaggerParameterSchema :: SwaggerParameterSchema
276+ , _swaggerParameterSchema :: SwaggerParameterSchema
277 } deriving (Eq, Show, Generic)
277 } deriving (Eq, Show, Generic)
278
278
279data SwaggerParameterSchema
279data SwaggerParameterSchema
@@ -283,7 +283,7 @@ data SwaggerParameterSchema
283
283
284data SwaggerParameterOtherSchema = SwaggerParameterOtherSchema
284data SwaggerParameterOtherSchema = SwaggerParameterOtherSchema
285 { -- | The location of the parameter.
285 { -- | The location of the parameter.
286− swaggerParameterOtherSchemaIn :: SwaggerParameterLocation
286+ _swaggerParameterOtherSchemaIn :: SwaggerParameterLocation
287
287
288 -- | The type of the parameter.
288 -- | The type of the parameter.
289 -- Since the parameter is not located at the request body,
289 -- Since the parameter is not located at the request body,
@@ -291,26 +291,26 @@ data SwaggerParameterOtherSchema = SwaggerParameterOtherSchema
291 -- If type is @'SwaggerParamFile'@, the @consumes@ MUST be either
291 -- If type is @'SwaggerParamFile'@, the @consumes@ MUST be either
292 -- "multipart/form-data" or " application/x-www-form-urlencoded"
292 -- "multipart/form-data" or " application/x-www-form-urlencoded"
293 -- and the parameter MUST be in @'SwaggerParameterFormData'@.
293 -- and the parameter MUST be in @'SwaggerParameterFormData'@.
294− , swaggerParameterOtherSchemaType :: SwaggerParameterType
294+ , _swaggerParameterOtherSchemaType :: SwaggerParameterType
295
295
296 -- | The extending format for the previously mentioned type.
296 -- | The extending format for the previously mentioned type.
297− , swaggerParameterOtherSchemaFormat :: Maybe SwaggerFormat
297+ , _swaggerParameterOtherSchemaFormat :: Maybe SwaggerFormat
298
298
299 -- | Sets the ability to pass empty-valued parameters.
299 -- | Sets the ability to pass empty-valued parameters.
300 -- This is valid only for either @'SwaggerParameterQuery'@ or @'SwaggerParameterFormData'@
300 -- This is valid only for either @'SwaggerParameterQuery'@ or @'SwaggerParameterFormData'@
301 -- and allows you to send a parameter with a name only or an empty value.
301 -- and allows you to send a parameter with a name only or an empty value.
302 -- Default value is @False@.
302 -- Default value is @False@.
303− , swaggerParameterOtherSchemaAllowEmptyValue :: Bool
303+ , _swaggerParameterOtherSchemaAllowEmptyValue :: Bool
304
304
305 -- | __Required if type is @'SwaggerParamArray'@__.
305 -- | __Required if type is @'SwaggerParamArray'@__.
306 -- Describes the type of items in the array.
306 -- Describes the type of items in the array.
307− , swaggerParameterOtherSchemaItems :: Maybe SwaggerItems
307+ , _swaggerParameterOtherSchemaItems :: Maybe SwaggerItems
308
308
309 -- | Determines the format of the array if @'SwaggerParamArray'@ is used.
309 -- | Determines the format of the array if @'SwaggerParamArray'@ is used.
310 -- Default value is csv.
310 -- Default value is csv.
311− , swaggerParameterOtherSchemaCollectionFormat :: Maybe SwaggerCollectionFormat
311+ , _swaggerParameterOtherSchemaCollectionFormat :: Maybe SwaggerCollectionFormat
312
312
313− , swaggerParameterOtherSchemaCommon :: SwaggerSchemaCommon
313+ , _swaggerParameterOtherSchemaCommon :: SwaggerSchemaCommon
314 } deriving (Eq, Show, Generic)
314 } deriving (Eq, Show, Generic)
315
315
316data SwaggerParameterType
316data SwaggerParameterType
@@ -384,27 +384,27 @@ data SwaggerItemsCollectionFormat
384type SwaggerParamName = Text
384type SwaggerParamName = Text
385
385
386data SwaggerSchema = SwaggerSchema
386data SwaggerSchema = SwaggerSchema
387− { swaggerSchemaType :: SwaggerSchemaType
387+ { _swaggerSchemaType :: SwaggerSchemaType
388− , swaggerSchemaFormat :: Maybe SwaggerFormat
388+ , _swaggerSchemaFormat :: Maybe SwaggerFormat
389− , swaggerSchemaTitle :: Maybe Text
389+ , _swaggerSchemaTitle :: Maybe Text
390− , swaggerSchemaDescription :: Maybe Text
390+ , _swaggerSchemaDescription :: Maybe Text
391− , swaggerSchemaRequired :: [SwaggerParamName]
391+ , _swaggerSchemaRequired :: [SwaggerParamName]
392−
392+
393− , swaggerSchemaItems :: Maybe SwaggerSchemaItems
393+ , _swaggerSchemaItems :: Maybe SwaggerSchemaItems
394− , swaggerSchemaAllOf :: Maybe [SwaggerSchema]
394+ , _swaggerSchemaAllOf :: Maybe [SwaggerSchema]
395− , swaggerSchemaProperties :: HashMap Text (SwaggerReferenced SwaggerSchema)
395+ , _swaggerSchemaProperties :: HashMap Text (SwaggerReferenced SwaggerSchema)
396− , swaggerSchemaAdditionalProperties :: Maybe SwaggerSchema
396+ , _swaggerSchemaAdditionalProperties :: Maybe SwaggerSchema
397−
397+
398− , swaggerSchemaDiscriminator :: Maybe Text
398+ , _swaggerSchemaDiscriminator :: Maybe Text
399− , swaggerSchemaReadOnly :: Maybe Bool
399+ , _swaggerSchemaReadOnly :: Maybe Bool
400− , swaggerSchemaXml :: Maybe SwaggerXml
400+ , _swaggerSchemaXml :: Maybe SwaggerXml
401− , swaggerSchemaExternalDocs :: Maybe SwaggerExternalDocs
401+ , _swaggerSchemaExternalDocs :: Maybe SwaggerExternalDocs
402− , swaggerSchemaExample :: Maybe Value
402+ , _swaggerSchemaExample :: Maybe Value
403−
403+
404− , swaggerSchemaMaxProperties :: Maybe Integer
404+ , _swaggerSchemaMaxProperties :: Maybe Integer
405− , swaggerSchemaMinProperties :: Maybe Integer
405+ , _swaggerSchemaMinProperties :: Maybe Integer
406−
406+
407− , swaggerSchemaCommon :: SwaggerSchemaCommon
407+ , _swaggerSchemaCommon :: SwaggerSchemaCommon
408 } deriving (Eq, Show, Generic)
408 } deriving (Eq, Show, Generic)
409
409
410data SwaggerSchemaItems
410data SwaggerSchemaItems
@@ -418,20 +418,20 @@ data SwaggerSchemaCommon = SwaggerSchemaCommon
418 -- if not supplied by the client in the request.
418 -- if not supplied by the client in the request.
419 -- (Note: "default" has no meaning for required parameters.)
419 -- (Note: "default" has no meaning for required parameters.)
420 -- Unlike JSON Schema this value MUST conform to the defined type for this parameter.
420 -- Unlike JSON Schema this value MUST conform to the defined type for this parameter.
421− swaggerSchemaDefault :: Maybe Value
421+ _swaggerSchemaDefault :: Maybe Value
422−
422+
423− , swaggerSchemaMaximum :: Maybe Integer
423+ , _swaggerSchemaMaximum :: Maybe Integer
424− , swaggerSchemaExclusiveMaximum :: Maybe Bool
424+ , _swaggerSchemaExclusiveMaximum :: Maybe Bool
425− , swaggerSchemaMinimum :: Maybe Integer
425+ , _swaggerSchemaMinimum :: Maybe Integer
426− , swaggerSchemaExclusiveMinimum :: Maybe Bool
426+ , _swaggerSchemaExclusiveMinimum :: Maybe Bool
427− , swaggerSchemaMaxLength :: Maybe Integer
427+ , _swaggerSchemaMaxLength :: Maybe Integer
428− , swaggerSchemaMinLength :: Maybe Integer
428+ , _swaggerSchemaMinLength :: Maybe Integer
429− , swaggerSchemaPattern :: Maybe Text
429+ , _swaggerSchemaPattern :: Maybe Text
430− , swaggerSchemaMaxItems :: Maybe Integer
430+ , _swaggerSchemaMaxItems :: Maybe Integer
431− , swaggerSchemaMinItems :: Maybe Integer
431+ , _swaggerSchemaMinItems :: Maybe Integer
432− , swaggerSchemaUniqueItems :: Maybe Bool
432+ , _swaggerSchemaUniqueItems :: Maybe Bool
433− , swaggerSchemaEnum :: Maybe [Value]
433+ , _swaggerSchemaEnum :: Maybe [Value]
434− , swaggerSchemaMultipleOf :: Maybe Integer
434+ , _swaggerSchemaMultipleOf :: Maybe Integer
435 } deriving (Eq, Show, Generic)
435 } deriving (Eq, Show, Generic)
436
436
437data SwaggerXml = SwaggerXml
437data SwaggerXml = SwaggerXml
@@ -440,18 +440,18 @@ data SwaggerXml = SwaggerXml
440 -- When defined alongside type being array (outside the items),
440 -- When defined alongside type being array (outside the items),
441 -- it will affect the wrapping element and only if wrapped is true.
441 -- it will affect the wrapping element and only if wrapped is true.
442 -- If wrapped is false, it will be ignored.
442 -- If wrapped is false, it will be ignored.
443− swaggerXmlName :: Maybe Text
443+ _swaggerXmlName :: Maybe Text
444
444
445 -- | The URL of the namespace definition.
445 -- | The URL of the namespace definition.
446 -- Value SHOULD be in the form of a URL.
446 -- Value SHOULD be in the form of a URL.
447− , swaggerXmlNamespace :: Maybe Text
447+ , _swaggerXmlNamespace :: Maybe Text
448
448
449 -- | The prefix to be used for the name.
449 -- | The prefix to be used for the name.
450− , swaggerXmlPrefix :: Maybe Text
450+ , _swaggerXmlPrefix :: Maybe Text
451
451
452 -- | Declares whether the property definition translates to an attribute instead of an element.
452 -- | Declares whether the property definition translates to an attribute instead of an element.
453 -- Default value is @False@.
453 -- Default value is @False@.
454− , swaggerXmlAttribute :: Bool
454+ , _swaggerXmlAttribute :: Bool
455
455
456 -- | MAY be used only for an array definition.
456 -- | MAY be used only for an array definition.
457 -- Signifies whether the array is wrapped
457 -- Signifies whether the array is wrapped
@@ -459,25 +459,25 @@ data SwaggerXml = SwaggerXml
459 -- or unwrapped (@\<book/\>\<book/\>@).
459 -- or unwrapped (@\<book/\>\<book/\>@).
460 -- Default value is @False@.
460 -- Default value is @False@.
461 -- The definition takes effect only when defined alongside type being array (outside the items).
461 -- The definition takes effect only when defined alongside type being array (outside the items).
462− , swaggerXmlWrapped :: Bool
462+ , _swaggerXmlWrapped :: Bool
463 } deriving (Eq, Show, Generic)
463 } deriving (Eq, Show, Generic)
464
464
465data SwaggerItems = SwaggerItems
465data SwaggerItems = SwaggerItems
466 { -- | The internal type of the array.
466 { -- | The internal type of the array.
467− swaggerItemsType :: SwaggerItemsType
467+ _swaggerItemsType :: SwaggerItemsType
468
468
469 -- | The extending format for the previously mentioned type.
469 -- | The extending format for the previously mentioned type.
470− , swaggerItemsFormat :: Maybe SwaggerFormat
470+ , _swaggerItemsFormat :: Maybe SwaggerFormat
471
471
472 -- | __Required if type is @'SwaggerItemsArray'@.__
472 -- | __Required if type is @'SwaggerItemsArray'@.__
473 -- Describes the type of items in the array.
473 -- Describes the type of items in the array.
474− , swaggerItemsItems :: Maybe SwaggerItems
474+ , _swaggerItemsItems :: Maybe SwaggerItems
475
475
476 -- | Determines the format of the array if type array is used.
476 -- | Determines the format of the array if type array is used.
477 -- Default value is @'SwaggerItemsCollectionCSV'@.
477 -- Default value is @'SwaggerItemsCollectionCSV'@.
478− , swaggerItemsCollectionFormat :: Maybe SwaggerItemsCollectionFormat
478+ , _swaggerItemsCollectionFormat :: Maybe SwaggerItemsCollectionFormat
479
479
480− , swaggerItemsCommon :: SwaggerSchemaCommon
480+ , _swaggerItemsCommon :: SwaggerSchemaCommon
481 } deriving (Eq, Show, Generic)
481 } deriving (Eq, Show, Generic)
482
482
483-- | A container for the expected responses of an operation.
483-- | A container for the expected responses of an operation.
@@ -488,11 +488,11 @@ data SwaggerItems = SwaggerItems
488data SwaggerResponses = SwaggerResponses
488data SwaggerResponses = SwaggerResponses
489 { -- | The documentation of responses other than the ones declared for specific HTTP response codes.
489 { -- | The documentation of responses other than the ones declared for specific HTTP response codes.
490 -- It can be used to cover undeclared responses.
490 -- It can be used to cover undeclared responses.
491− swaggerResponsesDefault :: Maybe (SwaggerReferenced SwaggerResponse)
491+ _swaggerResponsesDefault :: Maybe (SwaggerReferenced SwaggerResponse)
492
492
493 -- | Any HTTP status code can be used as the property name (one property per HTTP status code).
493 -- | Any HTTP status code can be used as the property name (one property per HTTP status code).
494 -- Describes the expected response for those HTTP status codes.
494 -- Describes the expected response for those HTTP status codes.
495− , swaggerResponsesResponses :: HashMap HttpStatusCode (SwaggerReferenced SwaggerResponse)
495+ , _swaggerResponsesResponses :: HashMap HttpStatusCode (SwaggerReferenced SwaggerResponse)
496 } deriving (Eq, Show, Generic)
496 } deriving (Eq, Show, Generic)
497
497
498type HttpStatusCode = Int
498type HttpStatusCode = Int
@@ -501,43 +501,43 @@ type HttpStatusCode = Int
501data SwaggerResponse = SwaggerResponse
501data SwaggerResponse = SwaggerResponse
502 { -- | A short description of the response.
502 { -- | A short description of the response.
503 -- GFM syntax can be used for rich text representation.
503 -- GFM syntax can be used for rich text representation.
504− swaggerResponseDescription :: Text
504+ _swaggerResponseDescription :: Text
505
505
506 -- | A definition of the response structure.
506 -- | A definition of the response structure.
507 -- It can be a primitive, an array or an object.
507 -- It can be a primitive, an array or an object.
508 -- If this field does not exist, it means no content is returned as part of the response.
508 -- If this field does not exist, it means no content is returned as part of the response.
509 -- As an extension to the Schema Object, its root type value may also be "file".
509 -- As an extension to the Schema Object, its root type value may also be "file".
510 -- This SHOULD be accompanied by a relevant produces mime-type.
510 -- This SHOULD be accompanied by a relevant produces mime-type.
511− , swaggerResponseSchema :: Maybe (SwaggerReferenced SwaggerSchema)
511+ , _swaggerResponseSchema :: Maybe (SwaggerReferenced SwaggerSchema)
512
512
513 -- | A list of headers that are sent with the response.
513 -- | A list of headers that are sent with the response.
514− , swaggerResponseHeaders :: HashMap HeaderName SwaggerHeader
514+ , _swaggerResponseHeaders :: HashMap HeaderName SwaggerHeader
515
515
516 -- | An example of the response message.
516 -- | An example of the response message.
517− , swaggerResponseExamples :: Maybe SwaggerExample
517+ , _swaggerResponseExamples :: Maybe SwaggerExample
518 } deriving (Eq, Show, Generic)
518 } deriving (Eq, Show, Generic)
519
519
520type HeaderName = Text
520type HeaderName = Text
521
521
522data SwaggerHeader = SwaggerHeader
522data SwaggerHeader = SwaggerHeader
523 { -- | A short description of the header.
523 { -- | A short description of the header.
524− swaggerHeaderDescription :: Maybe String
524+ _swaggerHeaderDescription :: Maybe Text
525
525
526 -- | The type of the object.
526 -- | The type of the object.
527− , swaggerHeaderType :: SwaggerItemsType
527+ , _swaggerHeaderType :: SwaggerItemsType
528
528
529 -- | The extending format for the previously mentioned type. See Data Type Formats for further details.
529 -- | The extending format for the previously mentioned type. See Data Type Formats for further details.
530− , swaggerHeaderFormat :: Maybe SwaggerFormat
530+ , _swaggerHeaderFormat :: Maybe SwaggerFormat
531
531
532 -- | __Required if type is @'SwaggerItemsArray'@__.
532 -- | __Required if type is @'SwaggerItemsArray'@__.
533 -- Describes the type of items in the array.
533 -- Describes the type of items in the array.
534− , swaggerHeaderItems :: Maybe SwaggerItems
534+ , _swaggerHeaderItems :: Maybe SwaggerItems
535
535
536 -- | Determines the format of the array if type array is used.
536 -- | Determines the format of the array if type array is used.
537 -- Default value is @'SwaggerItemsCollectionCSV'@.
537 -- Default value is @'SwaggerItemsCollectionCSV'@.
538− , swaggerHeaderCollectionFormat :: Maybe SwaggerItemsCollectionFormat
538+ , _swaggerHeaderCollectionFormat :: Maybe SwaggerItemsCollectionFormat
539
539
540− , swaggerHeaderCommon :: SwaggerSchemaCommon
540+ , _swaggerHeaderCommon :: SwaggerSchemaCommon
541 } deriving (Eq, Show, Generic)
541 } deriving (Eq, Show, Generic)
542
542
543data SwaggerExample = SwaggerExample { getSwaggerExample :: Map MediaType Value }
543data SwaggerExample = SwaggerExample { getSwaggerExample :: Map MediaType Value }
@@ -551,10 +551,10 @@ data SwaggerApiKeyLocation
551
551
552data SwaggerApiKeyParams = SwaggerApiKeyParams
552data SwaggerApiKeyParams = SwaggerApiKeyParams
553 { -- | The name of the header or query parameter to be used.
553 { -- | The name of the header or query parameter to be used.
554− swaggerApiKeyName :: Text
554+ _swaggerApiKeyName :: Text
555
555
556 -- | The location of the API key.
556 -- | The location of the API key.
557− , swaggerApiKeyIn :: SwaggerApiKeyLocation
557+ , _swaggerApiKeyIn :: SwaggerApiKeyLocation
558 } deriving (Eq, Show)
558 } deriving (Eq, Show)
559
559
560-- | The authorization URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.
560-- | The authorization URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.
@@ -572,10 +572,10 @@ data SwaggerOAuth2Flow
572
572
573data SwaggerOAuth2Params = SwaggerOAuth2Params
573data SwaggerOAuth2Params = SwaggerOAuth2Params
574 { -- | The flow used by the OAuth2 security scheme.
574 { -- | The flow used by the OAuth2 security scheme.
575− swaggerOAuth2Flow :: SwaggerOAuth2Flow
575+ _swaggerOAuth2Flow :: SwaggerOAuth2Flow
576
576
577 -- | The available scopes for the OAuth2 security scheme.
577 -- | The available scopes for the OAuth2 security scheme.
578− , swaggerOAuth2Scopes :: HashMap Text Text
578+ , _swaggerOAuth2Scopes :: HashMap Text Text
579 } deriving (Eq, Show, Generic)
579 } deriving (Eq, Show, Generic)
580
580
581data SwaggerSecuritySchemeType
581data SwaggerSecuritySchemeType
@@ -586,10 +586,10 @@ data SwaggerSecuritySchemeType
586
586
587data SwaggerSecurityScheme = SwaggerSecurityScheme
587data SwaggerSecurityScheme = SwaggerSecurityScheme
588 { -- | The type of the security scheme.
588 { -- | The type of the security scheme.
589− swaggerSecuritySchemeType :: SwaggerSecuritySchemeType
589+ _swaggerSecuritySchemeType :: SwaggerSecuritySchemeType
590
590
591 -- | A short description for security scheme.
591 -- | A short description for security scheme.
592− , swaggerSecuritySchemeDescription :: Maybe Text
592+ , _swaggerSecuritySchemeDescription :: Maybe Text
593 } deriving (Eq, Show, Generic)
593 } deriving (Eq, Show, Generic)
594
594
595-- | Lists the required security schemes to execute this operation.
595-- | Lists the required security schemes to execute this operation.
@@ -603,24 +603,24 @@ newtype SwaggerSecurityRequirement = SwaggerSecurityRequirement
603-- It is not mandatory to have a @SwaggerTag@ per tag used there.
603-- It is not mandatory to have a @SwaggerTag@ per tag used there.
604data SwaggerTag = SwaggerTag
604data SwaggerTag = SwaggerTag
605 { -- | The name of the tag.
605 { -- | The name of the tag.
606− swaggerTagName :: Text
606+ _swaggerTagName :: Text
607
607
608 -- | A short description for the tag.
608 -- | A short description for the tag.
609 -- GFM syntax can be used for rich text representation.
609 -- GFM syntax can be used for rich text representation.
610− , swaggerTagDescription :: Maybe Text
610+ , _swaggerTagDescription :: Maybe Text
611
611
612 -- | Additional external documentation for this tag.
612 -- | Additional external documentation for this tag.
613− , swaggerTagExternalDocs :: Maybe SwaggerExternalDocs
613+ , _swaggerTagExternalDocs :: Maybe SwaggerExternalDocs
614 } deriving (Eq, Show)
614 } deriving (Eq, Show)
615
615
616-- | Allows referencing an external resource for extended documentation.
616-- | Allows referencing an external resource for extended documentation.
617data SwaggerExternalDocs = SwaggerExternalDocs
617data SwaggerExternalDocs = SwaggerExternalDocs
618 { -- | A short description of the target documentation.
618 { -- | A short description of the target documentation.
619 -- GFM syntax can be used for rich text representation.
619 -- GFM syntax can be used for rich text representation.
620− swaggerExternalDocsDescription :: Maybe Text
620+ _swaggerExternalDocsDescription :: Maybe Text
621
621
622 -- | The URL for the target documentation.
622 -- | The URL for the target documentation.
623− , swaggerExternalDocsUrl :: URL
623+ , _swaggerExternalDocsUrl :: URL
624 } deriving (Eq, Show, Generic)
624 } deriving (Eq, Show, Generic)
625
625
626-- | A simple object to allow referencing other definitions in the specification.
626-- | A simple object to allow referencing other definitions in the specification.
src/Data/Swagger/Internal/Utils.hs+1−1
@@ -32,7 +32,7 @@ hashMapReadKeys = hashMapTraverseKeys (maybe empty pure . readMaybe)
32
32
33jsonPrefix :: String -> Options
33jsonPrefix :: String -> Options
34jsonPrefix prefix = defaultOptions
34jsonPrefix prefix = defaultOptions
35− { fieldLabelModifier = modifier
35+ { fieldLabelModifier = modifier . drop 1
36 , constructorTagModifier = modifier
36 , constructorTagModifier = modifier
37 , sumEncoding = ObjectWithSingleField
37 , sumEncoding = ObjectWithSingleField
38 }
38 }
src/Data/Swagger/Lens.hsnew file+107
@@ -0,0 +1,107 @@
1+{-# LANGUAGE FlexibleInstances #-}
2+{-# LANGUAGE FunctionalDependencies #-}
3+{-# LANGUAGE MultiParamTypeClasses #-}
4+{-# LANGUAGE TemplateHaskell #-}
5+module Data.Swagger.Lens where
6+
7+import Control.Lens
8+import Control.Lens.TH
9+import Data.Aeson (Value)
10+import Data.Swagger.Internal
11+import Data.Text (Text)
12+
13+-- =======================================================================
14+-- TH derived lenses
15+-- =======================================================================
16+
17+makeLenses ''Swagger
18+makeLenses ''SwaggerHost
19+makeLenses ''SwaggerInfo
20+makeLenses ''SwaggerContact
21+makeLenses ''SwaggerLicense
22+makeLenses ''SwaggerPaths
23+makeLenses ''SwaggerPathItem
24+makeLenses ''SwaggerTag
25+makeLenses ''SwaggerOperation
26+makeLenses ''SwaggerParameter
27+makePrisms ''SwaggerParameterSchema
28+makeLenses ''SwaggerParameterOtherSchema
29+makeLenses ''SwaggerItems
30+makeLenses ''SwaggerHeader
31+makeLenses ''SwaggerSchema
32+makePrisms ''SwaggerSchemaItems
33+makeLenses ''SwaggerSchemaCommon
34+makeLenses ''SwaggerXml
35+makeLenses ''SwaggerResponses
36+makeLenses ''SwaggerResponse
37+makeLenses ''SwaggerSecurityScheme
38+makePrisms ''SwaggerSecuritySchemeType
39+makeLenses ''SwaggerApiKeyParams
40+makeLenses ''SwaggerOAuth2Params
41+makeLenses ''SwaggerExternalDocs
42+
43+-- =======================================================================
44+-- Helper classy lenses
45+-- =======================================================================
46+
47+class HasDescription s d | s -> d where
48+ description :: Lens' s d
49+
50+instance HasDescription SwaggerResponse Text where description = swaggerResponseDescription
51+instance HasDescription SwaggerInfo (Maybe Text) where description = swaggerInfoDescription
52+instance HasDescription SwaggerTag (Maybe Text) where description = swaggerTagDescription
53+instance HasDescription SwaggerOperation (Maybe Text) where description = swaggerOperationDescription
54+instance HasDescription SwaggerParameter (Maybe Text) where description = swaggerParameterDescription
55+instance HasDescription SwaggerHeader (Maybe Text) where description = swaggerHeaderDescription
56+instance HasDescription SwaggerSchema (Maybe Text) where description = swaggerSchemaDescription
57+instance HasDescription SwaggerSecurityScheme (Maybe Text) where description = swaggerSecuritySchemeDescription
58+instance HasDescription SwaggerExternalDocs (Maybe Text) where description = swaggerExternalDocsDescription
59+
60+class HasSwaggerSchemaCommon s where
61+ schemaCommon :: Lens' s SwaggerSchemaCommon
62+
63+instance HasSwaggerSchemaCommon SwaggerSchema where schemaCommon = swaggerSchemaCommon
64+instance HasSwaggerSchemaCommon SwaggerParameterOtherSchema where schemaCommon = swaggerParameterOtherSchemaCommon
65+instance HasSwaggerSchemaCommon SwaggerItems where schemaCommon = swaggerItemsCommon
66+instance HasSwaggerSchemaCommon SwaggerHeader where schemaCommon = swaggerHeaderCommon
67+instance HasSwaggerSchemaCommon SwaggerSchemaCommon where schemaCommon = id
68+
69+schemaDefault :: HasSwaggerSchemaCommon s => Lens' s (Maybe Value)
70+schemaDefault = schemaCommon.swaggerSchemaDefault
71+
72+schemaMaximum :: HasSwaggerSchemaCommon s => Lens' s (Maybe Integer)
73+schemaMaximum = schemaCommon.swaggerSchemaMaximum
74+
75+schemaExclusiveMaximum :: HasSwaggerSchemaCommon s => Lens' s (Maybe Bool)
76+schemaExclusiveMaximum = schemaCommon.swaggerSchemaExclusiveMaximum
77+
78+schemaMinimum :: HasSwaggerSchemaCommon s => Lens' s (Maybe Integer)
79+schemaMinimum = schemaCommon.swaggerSchemaMinimum
80+
81+schemaExclusiveMinimum :: HasSwaggerSchemaCommon s => Lens' s (Maybe Bool)
82+schemaExclusiveMinimum = schemaCommon.swaggerSchemaExclusiveMinimum
83+
84+schemaMaxLength :: HasSwaggerSchemaCommon s => Lens' s (Maybe Integer)
85+schemaMaxLength = schemaCommon.swaggerSchemaMaxLength
86+
87+schemaMinLength :: HasSwaggerSchemaCommon s => Lens' s (Maybe Integer)
88+schemaMinLength = schemaCommon.swaggerSchemaMinLength
89+
90+schemaPattern :: HasSwaggerSchemaCommon s => Lens' s (Maybe Text)
91+schemaPattern = schemaCommon.swaggerSchemaPattern
92+
93+schemaMaxItems :: HasSwaggerSchemaCommon s => Lens' s (Maybe Integer)
94+schemaMaxItems = schemaCommon.swaggerSchemaMaxItems
95+
96+schemaMinItems :: HasSwaggerSchemaCommon s => Lens' s (Maybe Integer)
97+schemaMinItems = schemaCommon.swaggerSchemaMinItems
98+
99+schemaUniqueItems :: HasSwaggerSchemaCommon s => Lens' s (Maybe Bool)
100+schemaUniqueItems = schemaCommon.swaggerSchemaUniqueItems
101+
102+schemaEnum :: HasSwaggerSchemaCommon s => Lens' s (Maybe [Value])
103+schemaEnum = schemaCommon.swaggerSchemaEnum
104+
105+schemaMultipleOf :: HasSwaggerSchemaCommon s => Lens' s (Maybe Integer)
106+schemaMultipleOf = schemaCommon.swaggerSchemaMultipleOf
107+
swagger2.cabal+4
@@ -18,6 +18,9 @@ library
18 hs-source-dirs: src
18 hs-source-dirs: src
19 exposed-modules:
19 exposed-modules:
20 Data.Swagger
20 Data.Swagger
21+ Data.Swagger.Lens
22+
23+ -- internal modules
21 Data.Swagger.Internal
24 Data.Swagger.Internal
22 Data.Swagger.Internal.Utils
25 Data.Swagger.Internal.Utils
23 build-depends: base == 4.*
26 build-depends: base == 4.*
@@ -29,6 +32,7 @@ library
29 , template-haskell
32 , template-haskell
30 , text
33 , text
31 , unordered-containers
34 , unordered-containers
35+ , lens
32 default-language: Haskell2010
36 default-language: Haskell2010
33
37
34test-suite spec
38test-suite spec
test/Data/SwaggerSpec.hs+123−123
@@ -70,16 +70,16 @@ main = hspec spec
70
70
71infoExample :: SwaggerInfo
71infoExample :: SwaggerInfo
72infoExample = SwaggerInfo
72infoExample = SwaggerInfo
73− { swaggerInfoTitle = "Swagger Sample App"
73+ { _swaggerInfoTitle = "Swagger Sample App"
74− , swaggerInfoDescription = Just "This is a sample server Petstore server."
74+ , _swaggerInfoDescription = Just "This is a sample server Petstore server."
75− , swaggerInfoTermsOfService = Just "http://swagger.io/terms/"
75+ , _swaggerInfoTermsOfService = Just "http://swagger.io/terms/"
76− , swaggerInfoContact = Just contactExample
76+ , _swaggerInfoContact = Just contactExample
77− , swaggerInfoLicense = Just licenseExample
77+ , _swaggerInfoLicense = Just licenseExample
78− , swaggerInfoVersion = "1.0.1" }
78+ , _swaggerInfoVersion = "1.0.1" }
79 where
79 where
80 license = SwaggerLicense
80 license = SwaggerLicense
81− { swaggerLicenseName = "Apache 2.0"
81+ { _swaggerLicenseName = "Apache 2.0"
82− , swaggerLicenseUrl = Just (URL "http://www.apache.org/licenses/LICENSE-2.0.html") }
82+ , _swaggerLicenseUrl = Just (URL "http://www.apache.org/licenses/LICENSE-2.0.html") }
83
83
84infoExampleJSON :: Value
84infoExampleJSON :: Value
85infoExampleJSON = [aesonQQ|
85infoExampleJSON = [aesonQQ|
@@ -106,9 +106,9 @@ infoExampleJSON = [aesonQQ|
106
106
107contactExample :: SwaggerContact
107contactExample :: SwaggerContact
108contactExample = SwaggerContact
108contactExample = SwaggerContact
109− { swaggerContactName = Just "API Support"
109+ { _swaggerContactName = Just "API Support"
110− , swaggerContactUrl = Just (URL "http://www.swagger.io/support")
110+ , _swaggerContactUrl = Just (URL "http://www.swagger.io/support")
111− , swaggerContactEmail = Just "support@swagger.io" }
111+ , _swaggerContactEmail = Just "support@swagger.io" }
112
112
113contactExampleJSON :: Value
113contactExampleJSON :: Value
114contactExampleJSON = [aesonQQ|
114contactExampleJSON = [aesonQQ|
@@ -125,8 +125,8 @@ contactExampleJSON = [aesonQQ|
125
125
126licenseExample :: SwaggerLicense
126licenseExample :: SwaggerLicense
127licenseExample = SwaggerLicense
127licenseExample = SwaggerLicense
128− { swaggerLicenseName = "Apache 2.0"
128+ { _swaggerLicenseName = "Apache 2.0"
129− , swaggerLicenseUrl = Just (URL "http://www.apache.org/licenses/LICENSE-2.0.html") }
129+ , _swaggerLicenseUrl = Just (URL "http://www.apache.org/licenses/LICENSE-2.0.html") }
130
130
131licenseExampleJSON :: Value
131licenseExampleJSON :: Value
132licenseExampleJSON = [aesonQQ|
132licenseExampleJSON = [aesonQQ|
@@ -143,45 +143,45 @@ licenseExampleJSON = [aesonQQ|
143
143
144operationExample :: SwaggerOperation
144operationExample :: SwaggerOperation
145operationExample = mempty
145operationExample = mempty
146− { swaggerOperationTags = ["pet"]
146+ { _swaggerOperationTags = ["pet"]
147− , swaggerOperationSummary = Just "Updates a pet in the store with form data"
147+ , _swaggerOperationSummary = Just "Updates a pet in the store with form data"
148− , swaggerOperationDescription = Just ""
148+ , _swaggerOperationDescription = Just ""
149− , swaggerOperationOperationId = Just "updatePetWithForm"
149+ , _swaggerOperationOperationId = Just "updatePetWithForm"
150− , swaggerOperationConsumes = Just (SwaggerMimeList ["application/x-www-form-urlencoded"])
150+ , _swaggerOperationConsumes = Just (SwaggerMimeList ["application/x-www-form-urlencoded"])
151− , swaggerOperationProduces = Just (SwaggerMimeList ["application/json", "application/xml"])
151+ , _swaggerOperationProduces = Just (SwaggerMimeList ["application/json", "application/xml"])
152− , swaggerOperationParameters = params
152+ , _swaggerOperationParameters = params
153− , swaggerOperationResponses = responses
153+ , _swaggerOperationResponses = responses
154− , swaggerOperationSecurity = security
154+ , _swaggerOperationSecurity = security
155 }
155 }
156 where
156 where
157 security = [SwaggerSecurityRequirement [("petstore_auth", ["write:pets", "read:pets"])]]
157 security = [SwaggerSecurityRequirement [("petstore_auth", ["write:pets", "read:pets"])]]
158
158
159 responses = mempty
159 responses = mempty
160− { swaggerResponsesResponses =
160+ { _swaggerResponsesResponses =
161− [ (200, SwaggerInline mempty { swaggerResponseDescription = "Pet updated." })
161+ [ (200, SwaggerInline mempty { _swaggerResponseDescription = "Pet updated." })
162− , (405, SwaggerInline mempty { swaggerResponseDescription = "Invalid input" }) ] }
162+ , (405, SwaggerInline mempty { _swaggerResponseDescription = "Invalid input" }) ] }
163
163
164 params = map SwaggerInline
164 params = map SwaggerInline
165 [ SwaggerParameter
165 [ SwaggerParameter
166− { swaggerParameterName = "petId"
166+ { _swaggerParameterName = "petId"
167− , swaggerParameterDescription = Just "ID of pet that needs to be updated"
167+ , _swaggerParameterDescription = Just "ID of pet that needs to be updated"
168− , swaggerParameterRequired = True
168+ , _swaggerParameterRequired = True
169− , swaggerParameterSchema = SwaggerParameterOther (stringSchema SwaggerParameterPath) }
169+ , _swaggerParameterSchema = SwaggerParameterOther (stringSchema SwaggerParameterPath) }
170 , SwaggerParameter
170 , SwaggerParameter
171− { swaggerParameterName = "name"
171+ { _swaggerParameterName = "name"
172− , swaggerParameterDescription = Just "Updated name of the pet"
172+ , _swaggerParameterDescription = Just "Updated name of the pet"
173− , swaggerParameterRequired = False
173+ , _swaggerParameterRequired = False
174− , swaggerParameterSchema = SwaggerParameterOther (stringSchema SwaggerParameterFormData) }
174+ , _swaggerParameterSchema = SwaggerParameterOther (stringSchema SwaggerParameterFormData) }
175 , SwaggerParameter
175 , SwaggerParameter
176− { swaggerParameterName = "status"
176+ { _swaggerParameterName = "status"
177− , swaggerParameterDescription = Just "Updated status of the pet"
177+ , _swaggerParameterDescription = Just "Updated status of the pet"
178− , swaggerParameterRequired = False
178+ , _swaggerParameterRequired = False
179− , swaggerParameterSchema = SwaggerParameterOther (stringSchema SwaggerParameterFormData) }
179+ , _swaggerParameterSchema = SwaggerParameterOther (stringSchema SwaggerParameterFormData) }
180 ]
180 ]
181
181
182 stringSchema i = mempty
182 stringSchema i = mempty
183− { swaggerParameterOtherSchemaIn = i
183+ { _swaggerParameterOtherSchemaIn = i
184− , swaggerParameterOtherSchemaType = SwaggerParamString
184+ , _swaggerParameterOtherSchemaType = SwaggerParamString
185 }
185 }
186
186
187operationExampleJSON :: Value
187operationExampleJSON :: Value
@@ -248,8 +248,8 @@ operationExampleJSON = [aesonQQ|
248
248
249schemaPrimitiveExample :: SwaggerSchema
249schemaPrimitiveExample :: SwaggerSchema
250schemaPrimitiveExample = mempty
250schemaPrimitiveExample = mempty
251− { swaggerSchemaType = SwaggerSchemaString
251+ { _swaggerSchemaType = SwaggerSchemaString
252− , swaggerSchemaFormat = Just "email"
252+ , _swaggerSchemaFormat = Just "email"
253 }
253 }
254
254
255schemaPrimitiveExampleJSON :: Value
255schemaPrimitiveExampleJSON :: Value
@@ -262,17 +262,17 @@ schemaPrimitiveExampleJSON = [aesonQQ|
262
262
263schemaSimpleModelExample :: SwaggerSchema
263schemaSimpleModelExample :: SwaggerSchema
264schemaSimpleModelExample = mempty
264schemaSimpleModelExample = mempty
265− { swaggerSchemaType = SwaggerSchemaObject
265+ { _swaggerSchemaType = SwaggerSchemaObject
266− , swaggerSchemaRequired = [ "name" ]
266+ , _swaggerSchemaRequired = [ "name" ]
267− , swaggerSchemaProperties =
267+ , _swaggerSchemaProperties =
268 [ ("name", SwaggerInline mempty
268 [ ("name", SwaggerInline mempty
269− { swaggerSchemaType = SwaggerSchemaString } )
269+ { _swaggerSchemaType = SwaggerSchemaString } )
270 , ("address", SwaggerRef (SwaggerReference "#/definitions/Address"))
270 , ("address", SwaggerRef (SwaggerReference "#/definitions/Address"))
271 , ("age", SwaggerInline mempty
271 , ("age", SwaggerInline mempty
272− { swaggerSchemaType = SwaggerSchemaInteger
272+ { _swaggerSchemaType = SwaggerSchemaInteger
273− , swaggerSchemaFormat = Just "int32"
273+ , _swaggerSchemaFormat = Just "int32"
274− , swaggerSchemaCommon = mempty
274+ , _swaggerSchemaCommon = mempty
275− { swaggerSchemaMinimum = Just 0 } } ) ] }
275+ { _swaggerSchemaMinimum = Just 0 } } ) ] }
276
276
277schemaSimpleModelExampleJSON :: Value
277schemaSimpleModelExampleJSON :: Value
278schemaSimpleModelExampleJSON = [aesonQQ|
278schemaSimpleModelExampleJSON = [aesonQQ|
@@ -299,9 +299,9 @@ schemaSimpleModelExampleJSON = [aesonQQ|
299
299
300schemaModelDictExample :: SwaggerSchema
300schemaModelDictExample :: SwaggerSchema
301schemaModelDictExample = mempty
301schemaModelDictExample = mempty
302− { swaggerSchemaType = SwaggerSchemaObject
302+ { _swaggerSchemaType = SwaggerSchemaObject
303− , swaggerSchemaAdditionalProperties = Just mempty
303+ , _swaggerSchemaAdditionalProperties = Just mempty
304− { swaggerSchemaType = SwaggerSchemaString } }
304+ { _swaggerSchemaType = SwaggerSchemaString } }
305
305
306schemaModelDictExampleJSON :: Value
306schemaModelDictExampleJSON :: Value
307schemaModelDictExampleJSON = [aesonQQ|
307schemaModelDictExampleJSON = [aesonQQ|
@@ -315,15 +315,15 @@ schemaModelDictExampleJSON = [aesonQQ|
315
315
316schemaWithExampleExample :: SwaggerSchema
316schemaWithExampleExample :: SwaggerSchema
317schemaWithExampleExample = mempty
317schemaWithExampleExample = mempty
318− { swaggerSchemaType = SwaggerSchemaObject
318+ { _swaggerSchemaType = SwaggerSchemaObject
319− , swaggerSchemaProperties =
319+ , _swaggerSchemaProperties =
320 [ ("id", SwaggerInline mempty
320 [ ("id", SwaggerInline mempty
321− { swaggerSchemaType = SwaggerSchemaInteger
321+ { _swaggerSchemaType = SwaggerSchemaInteger
322− , swaggerSchemaFormat = Just "int64" })
322+ , _swaggerSchemaFormat = Just "int64" })
323 , ("name", SwaggerInline mempty
323 , ("name", SwaggerInline mempty
324− { swaggerSchemaType = SwaggerSchemaString }) ]
324+ { _swaggerSchemaType = SwaggerSchemaString }) ]
325− , swaggerSchemaRequired = [ "name" ]
325+ , _swaggerSchemaRequired = [ "name" ]
326− , swaggerSchemaExample = Just [aesonQQ|
326+ , _swaggerSchemaExample = Just [aesonQQ|
327 {
327 {
328 "name": "Puma",
328 "name": "Puma",
329 "id": 1
329 "id": 1
@@ -360,21 +360,21 @@ schemaWithExampleExampleJSON = [aesonQQ|
360definitionsExample :: HashMap Text SwaggerSchema
360definitionsExample :: HashMap Text SwaggerSchema
361definitionsExample =
361definitionsExample =
362 [ ("Category", mempty
362 [ ("Category", mempty
363− { swaggerSchemaType = SwaggerSchemaObject
363+ { _swaggerSchemaType = SwaggerSchemaObject
364− , swaggerSchemaProperties =
364+ , _swaggerSchemaProperties =
365 [ ("id", SwaggerInline mempty
365 [ ("id", SwaggerInline mempty
366− { swaggerSchemaType = SwaggerSchemaInteger
366+ { _swaggerSchemaType = SwaggerSchemaInteger
367− , swaggerSchemaFormat = Just "int64" })
367+ , _swaggerSchemaFormat = Just "int64" })
368 , ("name", SwaggerInline mempty
368 , ("name", SwaggerInline mempty
369− { swaggerSchemaType = SwaggerSchemaString }) ] })
369+ { _swaggerSchemaType = SwaggerSchemaString }) ] })
370 , ("Tag", mempty
370 , ("Tag", mempty
371− { swaggerSchemaType = SwaggerSchemaObject
371+ { _swaggerSchemaType = SwaggerSchemaObject
372− , swaggerSchemaProperties =
372+ , _swaggerSchemaProperties =
373 [ ("id", SwaggerInline mempty
373 [ ("id", SwaggerInline mempty
374− { swaggerSchemaType = SwaggerSchemaInteger
374+ { _swaggerSchemaType = SwaggerSchemaInteger
375− , swaggerSchemaFormat = Just "int64" })
375+ , _swaggerSchemaFormat = Just "int64" })
376 , ("name", SwaggerInline mempty
376 , ("name", SwaggerInline mempty
377− { swaggerSchemaType = SwaggerSchemaString }) ] }) ]
377+ { _swaggerSchemaType = SwaggerSchemaString }) ] }) ]
378
378
379definitionsExampleJSON :: Value
379definitionsExampleJSON :: Value
380definitionsExampleJSON = [aesonQQ|
380definitionsExampleJSON = [aesonQQ|
@@ -413,21 +413,21 @@ definitionsExampleJSON = [aesonQQ|
413parametersDefinitionExample :: HashMap Text SwaggerParameter
413parametersDefinitionExample :: HashMap Text SwaggerParameter
414parametersDefinitionExample =
414parametersDefinitionExample =
415 [ ("skipParam", mempty
415 [ ("skipParam", mempty
416− { swaggerParameterName = "skip"
416+ { _swaggerParameterName = "skip"
417− , swaggerParameterDescription = Just "number of items to skip"
417+ , _swaggerParameterDescription = Just "number of items to skip"
418− , swaggerParameterRequired = True
418+ , _swaggerParameterRequired = True
419− , swaggerParameterSchema = SwaggerParameterOther mempty
419+ , _swaggerParameterSchema = SwaggerParameterOther mempty
420− { swaggerParameterOtherSchemaIn = SwaggerParameterQuery
420+ { _swaggerParameterOtherSchemaIn = SwaggerParameterQuery
421− , swaggerParameterOtherSchemaType = SwaggerParamInteger
421+ , _swaggerParameterOtherSchemaType = SwaggerParamInteger
422− , swaggerParameterOtherSchemaFormat = Just "int32" } })
422+ , _swaggerParameterOtherSchemaFormat = Just "int32" } })
423 , ("limitParam", mempty
423 , ("limitParam", mempty
424− { swaggerParameterName = "limit"
424+ { _swaggerParameterName = "limit"
425− , swaggerParameterDescription = Just "max records to return"
425+ , _swaggerParameterDescription = Just "max records to return"
426− , swaggerParameterRequired = True
426+ , _swaggerParameterRequired = True
427− , swaggerParameterSchema = SwaggerParameterOther mempty
427+ , _swaggerParameterSchema = SwaggerParameterOther mempty
428− { swaggerParameterOtherSchemaIn = SwaggerParameterQuery
428+ { _swaggerParameterOtherSchemaIn = SwaggerParameterQuery
429− , swaggerParameterOtherSchemaType = SwaggerParamInteger
429+ , _swaggerParameterOtherSchemaType = SwaggerParamInteger
430− , swaggerParameterOtherSchemaFormat = Just "int32" } }) ]
430+ , _swaggerParameterOtherSchemaFormat = Just "int32" } }) ]
431
431
432parametersDefinitionExampleJSON :: Value
432parametersDefinitionExampleJSON :: Value
433parametersDefinitionExampleJSON = [aesonQQ|
433parametersDefinitionExampleJSON = [aesonQQ|
@@ -457,8 +457,8 @@ parametersDefinitionExampleJSON = [aesonQQ|
457
457
458responsesDefinitionExample :: HashMap Text SwaggerResponse
458responsesDefinitionExample :: HashMap Text SwaggerResponse
459responsesDefinitionExample =
459responsesDefinitionExample =
460− [ ("NotFound", mempty { swaggerResponseDescription = "Entity not found." })
460+ [ ("NotFound", mempty { _swaggerResponseDescription = "Entity not found." })
461− , ("IllegalInput", mempty { swaggerResponseDescription = "Illegal input for operation." }) ]
461+ , ("IllegalInput", mempty { _swaggerResponseDescription = "Illegal input for operation." }) ]
462
462
463responsesDefinitionExampleJSON :: Value
463responsesDefinitionExampleJSON :: Value
464responsesDefinitionExampleJSON = [aesonQQ|
464responsesDefinitionExampleJSON = [aesonQQ|
@@ -479,15 +479,15 @@ responsesDefinitionExampleJSON = [aesonQQ|
479securityDefinitionsExample :: HashMap Text SwaggerSecurityScheme
479securityDefinitionsExample :: HashMap Text SwaggerSecurityScheme
480securityDefinitionsExample =
480securityDefinitionsExample =
481 [ ("api_key", SwaggerSecurityScheme
481 [ ("api_key", SwaggerSecurityScheme
482− { swaggerSecuritySchemeType = SwaggerSecuritySchemeApiKey (SwaggerApiKeyParams "api_key" SwaggerApiKeyHeader)
482+ { _swaggerSecuritySchemeType = SwaggerSecuritySchemeApiKey (SwaggerApiKeyParams "api_key" SwaggerApiKeyHeader)
483− , swaggerSecuritySchemeDescription = Nothing })
483+ , _swaggerSecuritySchemeDescription = Nothing })
484 , ("petstore_auth", SwaggerSecurityScheme
484 , ("petstore_auth", SwaggerSecurityScheme
485− { swaggerSecuritySchemeType = SwaggerSecuritySchemeOAuth2 (SwaggerOAuth2Params
485+ { _swaggerSecuritySchemeType = SwaggerSecuritySchemeOAuth2 (SwaggerOAuth2Params
486− { swaggerOAuth2Flow = SwaggerOAuth2Implicit "http://swagger.io/api/oauth/dialog"
486+ { _swaggerOAuth2Flow = SwaggerOAuth2Implicit "http://swagger.io/api/oauth/dialog"
487− , swaggerOAuth2Scopes =
487+ , _swaggerOAuth2Scopes =
488 [ ("write:pets", "modify pets in your account")
488 [ ("write:pets", "modify pets in your account")
489 , ("read:pets", "read your pets") ] } )
489 , ("read:pets", "read your pets") ] } )
490− , swaggerSecuritySchemeDescription = Nothing }) ]
490+ , _swaggerSecuritySchemeDescription = Nothing }) ]
491
491
492securityDefinitionsExampleJSON :: Value
492securityDefinitionsExampleJSON :: Value
493securityDefinitionsExampleJSON = [aesonQQ|
493securityDefinitionsExampleJSON = [aesonQQ|
@@ -515,47 +515,47 @@ securityDefinitionsExampleJSON = [aesonQQ|
515
515
516swaggerExample :: Swagger
516swaggerExample :: Swagger
517swaggerExample = mempty
517swaggerExample = mempty
518− { swaggerBasePath = Just "/"
518+ { _swaggerBasePath = Just "/"
519− , swaggerSchemes = Just [Http]
519+ , _swaggerSchemes = Just [Http]
520− , swaggerInfo = mempty
520+ , _swaggerInfo = mempty
521− { swaggerInfoVersion = "1.0"
521+ { _swaggerInfoVersion = "1.0"
522− , swaggerInfoTitle = "Todo API"
522+ , _swaggerInfoTitle = "Todo API"
523− , swaggerInfoLicense = Just SwaggerLicense
523+ , _swaggerInfoLicense = Just SwaggerLicense
524− { swaggerLicenseName = "MIT"
524+ { _swaggerLicenseName = "MIT"
525− , swaggerLicenseUrl = Just (URL "http://mit.com") }
525+ , _swaggerLicenseUrl = Just (URL "http://mit.com") }
526− , swaggerInfoDescription = Just "This is a an API that tests servant-swagger support for a Todo API" }
526+ , _swaggerInfoDescription = Just "This is a an API that tests servant-swagger support for a Todo API" }
527− , swaggerPaths = mempty
527+ , _swaggerPaths = mempty
528− { swaggerPathsMap =
528+ { _swaggerPathsMap =
529 [ ("/todo/{id}", mempty
529 [ ("/todo/{id}", mempty
530− { swaggerPathItemGet = Just mempty
530+ { _swaggerPathItemGet = Just mempty
531− { swaggerOperationResponses = mempty
531+ { _swaggerOperationResponses = mempty
532− { swaggerResponsesResponses =
532+ { _swaggerResponsesResponses =
533 [ (200, SwaggerInline mempty
533 [ (200, SwaggerInline mempty
534− { swaggerResponseSchema = Just $ SwaggerInline mempty
534+ { _swaggerResponseSchema = Just $ SwaggerInline mempty
535− { swaggerSchemaExample = Just [aesonQQ|
535+ { _swaggerSchemaExample = Just [aesonQQ|
536 {
536 {
537 "created": 100,
537 "created": 100,
538 "description": "get milk"
538 "description": "get milk"
539 } |]
539 } |]
540− , swaggerSchemaType = SwaggerSchemaObject
540+ , _swaggerSchemaType = SwaggerSchemaObject
541− , swaggerSchemaDescription = Just "This is some real Todo right here"
541+ , _swaggerSchemaDescription = Just "This is some real Todo right here"
542− , swaggerSchemaProperties =
542+ , _swaggerSchemaProperties =
543 [ ("created", SwaggerInline mempty
543 [ ("created", SwaggerInline mempty
544− { swaggerSchemaType = SwaggerSchemaInteger
544+ { _swaggerSchemaType = SwaggerSchemaInteger
545− , swaggerSchemaFormat = Just "int32" })
545+ , _swaggerSchemaFormat = Just "int32" })
546 , ("description", SwaggerInline mempty
546 , ("description", SwaggerInline mempty
547− { swaggerSchemaType = SwaggerSchemaString }) ] }
547+ { _swaggerSchemaType = SwaggerSchemaString }) ] }
548− , swaggerResponseDescription = "OK" }) ] }
548+ , _swaggerResponseDescription = "OK" }) ] }
549− , swaggerOperationProduces = Just (SwaggerMimeList [ "application/json" ])
549+ , _swaggerOperationProduces = Just (SwaggerMimeList [ "application/json" ])
550− , swaggerOperationParameters =
550+ , _swaggerOperationParameters =
551 [ SwaggerInline mempty
551 [ SwaggerInline mempty
552− { swaggerParameterRequired = True
552+ { _swaggerParameterRequired = True
553− , swaggerParameterName = "id"
553+ , _swaggerParameterName = "id"
554− , swaggerParameterDescription = Just "TodoId param"
554+ , _swaggerParameterDescription = Just "TodoId param"
555− , swaggerParameterSchema = SwaggerParameterOther mempty
555+ , _swaggerParameterSchema = SwaggerParameterOther mempty
556− { swaggerParameterOtherSchemaIn = SwaggerParameterPath
556+ { _swaggerParameterOtherSchemaIn = SwaggerParameterPath
557− , swaggerParameterOtherSchemaType = SwaggerParamString } } ]
557+ , _swaggerParameterOtherSchemaType = SwaggerParamString } } ]
558− , swaggerOperationTags = [ "todo" ] } }) ] } }
558+ , _swaggerOperationTags = [ "todo" ] } }) ] } }
559
559
560swaggerExampleJSON :: Value
560swaggerExampleJSON :: Value
561swaggerExampleJSON = [aesonQQ|
561swaggerExampleJSON = [aesonQQ|