@@ -576,12 +576,12 @@ data Link = Link
576-- __Warning__: OpenAPI 3.0 does not support tuple arrays. However, OpenAPI 3.1 will, as
576-- __Warning__: OpenAPI 3.0 does not support tuple arrays. However, OpenAPI 3.1 will, as
577-- it will incorporate Json Schema mostly verbatim.
577-- it will incorporate Json Schema mostly verbatim.
579−-- @'SwaggerItemsObject'@ should be used to specify homogenous array @'Schema'@s.
579+-- @'OpenApiItemsObject'@ should be used to specify homogenous array @'Schema'@s.
581−-- @'SwaggerItemsArray'@ should be used to specify tuple @'Schema'@s.
581+-- @'OpenApiItemsArray'@ should be used to specify tuple @'Schema'@s.
582−data SwaggerItems where
582+data OpenApiItems where
583− SwaggerItemsObject :: Referenced Schema -> SwaggerItems
583+ OpenApiItemsObject :: Referenced Schema -> OpenApiItems
584− SwaggerItemsArray :: [Referenced Schema] -> SwaggerItems
584+ OpenApiItemsArray :: [Referenced Schema] -> OpenApiItems
585 deriving (Eq, Show, Typeable, Data)
585 deriving (Eq, Show, Typeable, Data)
587data OpenApiType where
587data OpenApiType where
@@ -645,7 +645,7 @@ data Schema = Schema
646 , _schemaType :: Maybe OpenApiType
646 , _schemaType :: Maybe OpenApiType
647 , _schemaFormat :: Maybe Format
647 , _schemaFormat :: Maybe Format
648− , _schemaItems :: Maybe SwaggerItems
648+ , _schemaItems :: Maybe OpenApiItems
649 , _schemaMaximum :: Maybe Scientific
649 , _schemaMaximum :: Maybe Scientific
650 , _schemaExclusiveMaximum :: Maybe Bool
650 , _schemaExclusiveMaximum :: Maybe Bool
651 , _schemaMinimum :: Maybe Scientific
651 , _schemaMinimum :: Maybe Scientific
@@ -680,7 +680,7 @@ data NamedSchema = NamedSchema
681data Xml = Xml
681data Xml = Xml
682 { -- | Replaces the name of the element/attribute used for the described schema property.
682 { -- | Replaces the name of the element/attribute used for the described schema property.
683− -- When defined within the @'SwaggerItems'@ (items), it will affect the name of the individual XML elements within the list.
683+ -- When defined within the @'OpenApiItems'@ (items), it will affect the name of the individual XML elements within the list.
684 -- When defined alongside type being array (outside the items),
684 -- When defined alongside type being array (outside the items),
685 -- it will affect the wrapping element and only if wrapped is true.
685 -- it will affect the wrapping element and only if wrapped is true.
686 -- If wrapped is false, it will be ignored.
686 -- If wrapped is false, it will be ignored.
@@ -1269,17 +1269,17 @@ instance ToJSON Header where
1269-- | As for nullary schema for 0-arity type constructors, see
1269-- | As for nullary schema for 0-arity type constructors, see
1270-- <https://github.com/GetShopTV/swagger2/issues/167>.
1270-- <https://github.com/GetShopTV/swagger2/issues/167>.
1272−-- >>> encode (SwaggerItemsArray [])
1272+-- >>> encode (OpenApiItemsArray [])
1273-- "{\"example\":[],\"items\":{},\"maxItems\":0}"
1273-- "{\"example\":[],\"items\":{},\"maxItems\":0}"
1275−instance ToJSON SwaggerItems where
1275+instance ToJSON OpenApiItems where
1276− toJSON (SwaggerItemsObject x) = object [ "items" .= x ]
1276+ toJSON (OpenApiItemsObject x) = object [ "items" .= x ]
1277− toJSON (SwaggerItemsArray []) = object
1277+ toJSON (OpenApiItemsArray []) = object
1278 [ "items" .= object []
1278 [ "items" .= object []
1279 , "maxItems" .= (0 :: Int)
1279 , "maxItems" .= (0 :: Int)
1280 , "example" .= Array mempty
1280 , "example" .= Array mempty
1282− toJSON (SwaggerItemsArray x) = object [ "items" .= x ]
1282+ toJSON (OpenApiItemsArray x) = object [ "items" .= x ]
1284instance ToJSON Components where
1284instance ToJSON Components where
1285 toJSON = sopSwaggerGenericToJSON
1285 toJSON = sopSwaggerGenericToJSON
@@ -1399,7 +1399,7 @@ instance FromJSON Schema where
1399 parseJSON = fmap nullaryCleanup . sopSwaggerGenericParseJSON
1399 parseJSON = fmap nullaryCleanup . sopSwaggerGenericParseJSON
1400 where nullaryCleanup :: Schema -> Schema
1400 where nullaryCleanup :: Schema -> Schema
1401 nullaryCleanup s =
1401 nullaryCleanup s =
1402− if _schemaItems s == Just (SwaggerItemsArray [])
1402+ if _schemaItems s == Just (OpenApiItemsArray [])
1403 then s { _schemaExample = Nothing
1403 then s { _schemaExample = Nothing
1404 , _schemaMaxItems = Nothing
1404 , _schemaMaxItems = Nothing
@@ -1408,11 +1408,11 @@ instance FromJSON Schema where
1408instance FromJSON Header where
1408instance FromJSON Header where
1409 parseJSON = sopSwaggerGenericParseJSON
1409 parseJSON = sopSwaggerGenericParseJSON
1411−instance FromJSON SwaggerItems where
1411+instance FromJSON OpenApiItems where
1412 parseJSON js@(Object obj)
1412 parseJSON js@(Object obj)
1413− | null obj = pure $ SwaggerItemsArray [] -- Nullary schema.
1413+ | null obj = pure $ OpenApiItemsArray [] -- Nullary schema.
1414− | otherwise = SwaggerItemsObject <$> parseJSON js
1414+ | otherwise = OpenApiItemsObject <$> parseJSON js
1415− parseJSON js@(Array _) = SwaggerItemsArray <$> parseJSON js
1415+ parseJSON js@(Array _) = OpenApiItemsArray <$> parseJSON js
1416 parseJSON _ = empty
1416 parseJSON _ = empty
1418instance FromJSON Components where
1418instance FromJSON Components where