@@ -242,7 +242,7 @@ data SwaggerOperation = SwaggerOperation
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 :: Maybe Bool
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
@@ -270,7 +270,7 @@ data SwaggerParameter = SwaggerParameter
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 :: Maybe Bool
275 -- | Parameter schema.
275 -- | Parameter schema.
276 , _swaggerParameterSchema :: SwaggerParameterSchema
276 , _swaggerParameterSchema :: SwaggerParameterSchema
@@ -300,7 +300,7 @@ data SwaggerParameterOtherSchema = SwaggerParameterOtherSchema
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 :: Maybe Bool
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.
@@ -451,7 +451,7 @@ data SwaggerXml = SwaggerXml
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 :: Maybe Bool
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,7 +459,7 @@ 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 :: Maybe Bool
463 } deriving (Eq, Show, Generic)
463 } deriving (Eq, Show, Generic)
465data SwaggerItems = SwaggerItems
465data SwaggerItems = SwaggerItems
@@ -953,7 +953,6 @@ instance FromJSON SwaggerMimeList where
954instance FromJSON SwaggerParameter where
954instance FromJSON SwaggerParameter where
955 parseJSON = genericParseJSONWithSub "schema" (jsonPrefix "swaggerParameter")
955 parseJSON = genericParseJSONWithSub "schema" (jsonPrefix "swaggerParameter")
956− `withDefaults` [ "required" .= False ]
958instance FromJSON SwaggerParameterSchema where
957instance FromJSON SwaggerParameterSchema where
959 parseJSON json@(Object o) = do
958 parseJSON json@(Object o) = do
@@ -967,7 +966,6 @@ instance FromJSON SwaggerParameterSchema where
968instance FromJSON SwaggerParameterOtherSchema where
967instance FromJSON SwaggerParameterOtherSchema where
969 parseJSON = genericParseJSONWithSub "common" (jsonPrefix "swaggerParameterOtherSchema")
968 parseJSON = genericParseJSONWithSub "common" (jsonPrefix "swaggerParameterOtherSchema")
970− `withDefaults` [ "allowEmptyValue" .= False ]
972instance FromJSON SwaggerSchemaItems where
970instance FromJSON SwaggerSchemaItems where
973 parseJSON json@(Object _) = SwaggerSchemaItemsObject <$> parseJSON json
971 parseJSON json@(Object _) = SwaggerSchemaItemsObject <$> parseJSON json
@@ -991,8 +989,7 @@ instance FromJSON SwaggerResponse where
992instance FromJSON SwaggerOperation where
990instance FromJSON SwaggerOperation where
993 parseJSON = genericParseJSON (jsonPrefix "swaggerOperation")
991 parseJSON = genericParseJSON (jsonPrefix "swaggerOperation")
994− `withDefaults` [ "deprecated" .= False
995− , "security" .= ([] :: [SwaggerSecurityRequirement]) ]
992+ `withDefaults` [ "security" .= ([] :: [SwaggerSecurityRequirement]) ]
997instance FromJSON SwaggerPathItem where
994instance FromJSON SwaggerPathItem where
998 parseJSON = genericParseJSON (jsonPrefix "swaggerPathItem")
995 parseJSON = genericParseJSON (jsonPrefix "swaggerPathItem")
@@ -1009,5 +1006,4 @@ instance FromJSON a => FromJSON (SwaggerReferenced a) where
1010instance FromJSON SwaggerXml where
1007instance FromJSON SwaggerXml where
1011 parseJSON = genericParseJSON (jsonPrefix "swaggerXml")
1008 parseJSON = genericParseJSON (jsonPrefix "swaggerXml")
1012− `withDefaults` [ "attribute" .= False, "wrapped" .= False ]