@@ -64,7 +64,7 @@ data Swagger = Swagger
6464
6565 -- | An object to hold parameters that can be used across operations.
6666 -- This property does not define global parameters for all operations.
67− , _parameters :: HashMap Text Parameter
67+ , _parameters :: HashMap Text Param
6868
6969 -- | An object to hold responses that can be used across operations.
7070 -- This property does not define global responses for all operations.
@@ -187,7 +187,7 @@ data PathItem = PathItem
187187 -- These parameters can be overridden at the operation level, but cannot be removed there.
188188 -- The list MUST NOT include duplicated parameters.
189189 -- A unique parameter is defined by a combination of a name and location.
190− , _pathItemParameters :: [Referenced Parameter]
190+ , _pathItemParameters :: [Referenced Param]
191191 } deriving (Eq, Show, Generic)
192192
193193-- | Describes a single API operation on a path.
@@ -228,7 +228,7 @@ data Operation = Operation
228228 -- the new definition will override it, but can never remove it.
229229 -- The list MUST NOT include duplicated parameters.
230230 -- A unique parameter is defined by a combination of a name and location.
231− , _operationParameters :: [Referenced Parameter]
231+ , _operationParameters :: [Referenced Param]
232232
233233 -- | The list of possible responses as they are returned from executing this operation.
234234 , _operationResponses :: Responses
@@ -255,63 +255,63 @@ newtype MimeList = MimeList { getMimeList :: [MediaType] }
255255
256256-- | Describes a single operation parameter.
257257-- A unique parameter is defined by a combination of a name and location.
258−data Parameter = Parameter
258+data Param = Param
259259 { -- | The name of the parameter.
260260 -- Parameter names are case sensitive.
261− _parameterName :: Text
261+ _paramName :: Text
262262
263263 -- | A brief description of the parameter.
264264 -- This could contain examples of use.
265265 -- GFM syntax can be used for rich text representation.
266− , _parameterDescription :: Maybe Text
266+ , _paramDescription :: Maybe Text
267267
268268 -- | Determines whether this parameter is mandatory.
269269 -- If the parameter is in "path", this property is required and its value MUST be true.
270270 -- Otherwise, the property MAY be included and its default value is @False@.
271− , _parameterRequired :: Maybe Bool
271+ , _paramRequired :: Maybe Bool
272272
273273 -- | Parameter schema.
274− , _parameterSchema :: ParameterSchema
274+ , _paramSchema :: ParamSchema
275275 } deriving (Eq, Show, Generic)
276276
277−data ParameterSchema
278− = ParameterBody (Referenced Schema)
279− | ParameterOther ParameterOtherSchema
277+data ParamSchema
278+ = ParamBody (Referenced Schema)
279+ | ParamOther ParamOtherSchema
280280 deriving (Eq, Show)
281281
282−data ParameterOtherSchema = ParameterOtherSchema
282+data ParamOtherSchema = ParamOtherSchema
283283 { -- | The location of the parameter.
284− _parameterOtherSchemaIn :: ParameterLocation
284+ _paramOtherSchemaIn :: ParamLocation
285285
286286 -- | The type of the parameter.
287287 -- Since the parameter is not located at the request body,
288288 -- it is limited to simple types (that is, not an object).
289289 -- If type is @'ParamFile'@, the @consumes@ MUST be either
290290 -- "multipart/form-data" or " application/x-www-form-urlencoded"
291− -- and the parameter MUST be in @'ParameterFormData'@.
292− , _parameterOtherSchemaType :: ParameterType
291+ -- and the parameter MUST be in @'ParamFormData'@.
292+ , _paramOtherSchemaType :: ParamType
293293
294294 -- | The extending format for the previously mentioned type.
295− , _parameterOtherSchemaFormat :: Maybe Format
295+ , _paramOtherSchemaFormat :: Maybe Format
296296
297297 -- | Sets the ability to pass empty-valued parameters.
298− -- This is valid only for either @'ParameterQuery'@ or @'ParameterFormData'@
298+ -- This is valid only for either @'ParamQuery'@ or @'ParamFormData'@
299299 -- and allows you to send a parameter with a name only or an empty value.
300300 -- Default value is @False@.
301− , _parameterOtherSchemaAllowEmptyValue :: Maybe Bool
301+ , _paramOtherSchemaAllowEmptyValue :: Maybe Bool
302302
303303 -- | __Required if type is @'ParamArray'@__.
304304 -- Describes the type of items in the array.
305− , _parameterOtherSchemaItems :: Maybe Items
305+ , _paramOtherSchemaItems :: Maybe Items
306306
307307 -- | Determines the format of the array if @'ParamArray'@ is used.
308308 -- Default value is csv.
309− , _parameterOtherSchemaCollectionFormat :: Maybe CollectionFormat
309+ , _paramOtherSchemaCollectionFormat :: Maybe CollectionFormat
310310
311− , _parameterOtherSchemaCommon :: SchemaCommon
311+ , _paramOtherSchemaCommon :: SchemaCommon
312312 } deriving (Eq, Show, Generic)
313313
314−data ParameterType
314+data ParamType
315315 = ParamString
316316 | ParamNumber
317317 | ParamInteger
@@ -320,16 +320,16 @@ data ParameterType
320320 | ParamFile
321321 deriving (Eq, Show)
322322
323−data ParameterLocation
323+data ParamLocation
324324 = -- | Parameters that are appended to the URL.
325325 -- For example, in @/items?id=###@, the query parameter is @id@.
326− ParameterQuery
326+ ParamQuery
327327 -- | Custom headers that are expected as part of the request.
328− | ParameterHeader
328+ | ParamHeader
329329 -- | Used together with Path Templating, where the parameter value is actually part of the operation's URL.
330330 -- This does not include the host or base path of the API.
331331 -- For example, in @/items/{itemId}@, the path parameter is @itemId@.
332− | ParameterPath
332+ | ParamPath
333333 -- | Used to describe the payload of an HTTP request when either @application/x-www-form-urlencoded@
334334 -- or @multipart/form-data@ are used as the content type of the request
335335 -- (in Swagger's definition, the @consumes@ property of an operation).
@@ -337,7 +337,7 @@ data ParameterLocation
337337 -- Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation.
338338 -- Form parameters have a different format based on the content-type used
339339 -- (for further details, consult <http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4>).
340− | ParameterFormData
340+ | ParamFormData
341341 deriving (Eq, Show)
342342
343343type Format = Text
@@ -349,8 +349,8 @@ data CollectionFormat
349349 | CollectionTSV -- ^ Tab separated values: @foo\\tbar@.
350350 | CollectionPipes -- ^ Pipe separated values: @foo|bar@.
351351 | CollectionMulti -- ^ Corresponds to multiple parameter instances
352− -- instead of multiple values for a single instance @foo=bar&foo=baz@.
353− -- This is valid only for parameters in @'ParameterQuery'@ or @'ParameterFormData'@.
352+ -- instead of multiple values for a single instance @foo=bar&foo=baz@.
353+ -- This is valid only for parameters in @'ParamQuery'@ or @'ParamFormData'@.
354354 deriving (Eq, Show)
355355
356356data ItemsType
@@ -661,11 +661,11 @@ instance Monoid SchemaCommon where
661661 mempty = genericMempty
662662 mappend = genericMappend
663663
664−instance Monoid Parameter where
664+instance Monoid Param where
665665 mempty = genericMempty
666666 mappend = genericMappend
667667
668−instance Monoid ParameterOtherSchema where
668+instance Monoid ParamOtherSchema where
669669 mempty = genericMempty
670670 mappend = genericMappend
671671
@@ -694,8 +694,8 @@ instance SwaggerMonoid Paths
694694instance SwaggerMonoid PathItem
695695instance SwaggerMonoid Schema
696696instance SwaggerMonoid SchemaCommon
697−instance SwaggerMonoid Parameter
698−instance SwaggerMonoid ParameterOtherSchema
697+instance SwaggerMonoid Param
698+instance SwaggerMonoid ParamOtherSchema
699699instance SwaggerMonoid Responses
700700instance SwaggerMonoid Response
701701instance SwaggerMonoid ExternalDocs
@@ -708,12 +708,12 @@ instance SwaggerMonoid SchemaType where
708708 swaggerMempty = SchemaNull
709709 swaggerMappend _ y = y
710710
711−instance SwaggerMonoid ParameterType where
711+instance SwaggerMonoid ParamType where
712712 swaggerMempty = ParamString
713713 swaggerMappend _ y = y
714714
715−instance SwaggerMonoid ParameterLocation where
716− swaggerMempty = ParameterQuery
715+instance SwaggerMonoid ParamLocation where
716+ swaggerMempty = ParamQuery
717717 swaggerMappend _ y = y
718718
719719instance SwaggerMonoid (HashMap Text Schema) where
@@ -729,7 +729,7 @@ instance Monoid a => SwaggerMonoid (Referenced a) where
729729 swaggerMappend (Inline x) (Inline y) = Inline (x <> y)
730730 swaggerMappend _ y = y
731731
732−instance SwaggerMonoid (HashMap Text Parameter) where
732+instance SwaggerMonoid (HashMap Text Param) where
733733 swaggerMempty = HashMap.empty
734734 swaggerMappend = HashMap.unionWith mappend
735735
@@ -753,18 +753,18 @@ instance SwaggerMonoid (HashMap HttpStatusCode (Referenced Response)) where
753753 swaggerMempty = HashMap.empty
754754 swaggerMappend = flip HashMap.union
755755
756−instance SwaggerMonoid ParameterSchema where
757− swaggerMempty = ParameterOther swaggerMempty
758− swaggerMappend (ParameterBody x) (ParameterBody y) = ParameterBody (swaggerMappend x y)
759− swaggerMappend (ParameterOther x) (ParameterOther y) = ParameterOther (swaggerMappend x y)
756+instance SwaggerMonoid ParamSchema where
757+ swaggerMempty = ParamOther swaggerMempty
758+ swaggerMappend (ParamBody x) (ParamBody y) = ParamBody (swaggerMappend x y)
759+ swaggerMappend (ParamOther x) (ParamOther y) = ParamOther (swaggerMappend x y)
760760 swaggerMappend _ y = y
761761
762762-- =======================================================================
763763-- TH derived ToJSON and FromJSON instances
764764-- =======================================================================
765765
766−deriveJSON (jsonPrefix "Parameter") ''ParameterLocation
767−deriveJSON (jsonPrefix "Param") ''ParameterType
766+deriveJSON (jsonPrefix "Param") ''ParamLocation
767+deriveJSON (jsonPrefix "Param") ''ParamType
768768deriveJSON' ''Info
769769deriveJSON' ''Contact
770770deriveJSON' ''License
@@ -846,15 +846,15 @@ instance ToJSON Paths where
846846instance ToJSON MimeList where
847847 toJSON (MimeList xs) = toJSON (map show xs)
848848
849−instance ToJSON Parameter where
850− toJSON = genericToJSONWithSub "schema" (jsonPrefix "parameter")
849+instance ToJSON Param where
850+ toJSON = genericToJSONWithSub "schema" (jsonPrefix "param")
851851
852−instance ToJSON ParameterSchema where
853− toJSON (ParameterBody s) = object [ "in" .= ("body" :: Text), "schema" .= s ]
854− toJSON (ParameterOther s) = toJSON s
852+instance ToJSON ParamSchema where
853+ toJSON (ParamBody s) = object [ "in" .= ("body" :: Text), "schema" .= s ]
854+ toJSON (ParamOther s) = toJSON s
855855
856−instance ToJSON ParameterOtherSchema where
857− toJSON = genericToJSONWithSub "common" (jsonPrefix "parameterOtherSchema")
856+instance ToJSON ParamOtherSchema where
857+ toJSON = genericToJSONWithSub "common" (jsonPrefix "paramOtherSchema")
858858
859859instance ToJSON SchemaItems where
860860 toJSON (SchemaItemsObject x) = toJSON x
@@ -913,7 +913,7 @@ instance FromJSON Swagger where
913913 , "security" .= ([] :: [SecurityRequirement])
914914 , "tags" .= ([] :: [Tag])
915915 , "definitions" .= (mempty :: HashMap Text Schema)
916− , "parameters" .= (mempty :: HashMap Text Parameter)
916+ , "parameters" .= (mempty :: HashMap Text Param)
917917 , "responses" .= (mempty :: HashMap Text Response)
918918 , "securityDefinitions" .= (mempty :: HashMap Text SecurityScheme)
919919 ] ) js
@@ -949,21 +949,21 @@ instance FromJSON Paths where
949949instance FromJSON MimeList where
950950 parseJSON js = (MimeList . map fromString) <$> parseJSON js
951951
952−instance FromJSON Parameter where
953− parseJSON = genericParseJSONWithSub "schema" (jsonPrefix "parameter")
952+instance FromJSON Param where
953+ parseJSON = genericParseJSONWithSub "schema" (jsonPrefix "param")
954954
955−instance FromJSON ParameterSchema where
955+instance FromJSON ParamSchema where
956956 parseJSON js@(Object o) = do
957957 (i :: Text) <- o .: "in"
958958 case i of
959959 "body" -> do
960960 schema <- o .: "schema"
961− ParameterBody <$> parseJSON schema
962− _ -> ParameterOther <$> parseJSON js
961+ ParamBody <$> parseJSON schema
962+ _ -> ParamOther <$> parseJSON js
963963 parseJSON _ = empty
964964
965−instance FromJSON ParameterOtherSchema where
966− parseJSON = genericParseJSONWithSub "common" (jsonPrefix "parameterOtherSchema")
965+instance FromJSON ParamOtherSchema where
966+ parseJSON = genericParseJSONWithSub "common" (jsonPrefix "paramOtherSchema")
967967
968968instance FromJSON SchemaItems where
969969 parseJSON js@(Object _) = SchemaItemsObject <$> parseJSON js
@@ -991,7 +991,7 @@ instance FromJSON Operation where
991991
992992instance FromJSON PathItem where
993993 parseJSON = genericParseJSON (jsonPrefix "pathItem")
994− `withDefaults` [ "parameters" .= ([] :: [Parameter]) ]
994+ `withDefaults` [ "parameters" .= ([] :: [Param]) ]
995995
996996instance FromJSON Reference where
997997 parseJSON (Object o) = Reference <$> o .: "$ref"