From c22abc1924800d555e6cf1403925ae626f56d377 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Fri, 29 Mar 2024 09:29:56 -0400 Subject: [PATCH] Update example for minItems/NonEmpty change --- .../src/OpenAPI/Operations/CreateUsersWithArrayInput.hs | 8 ++++---- .../src/OpenAPI/Operations/CreateUsersWithListInput.hs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs b/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs index a6fd36f..632cd6c 100644 --- a/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs +++ b/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs @@ -48,7 +48,7 @@ import OpenAPI.Types -- | > POST /user/createWithArray -- -- -createUsersWithArrayInput :: forall m . OpenAPI.Common.MonadHTTP m => [User] -- ^ The request body to send +createUsersWithArrayInput :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Base.NonEmpty User -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response CreateUsersWithArrayInputResponse) -- ^ Monadic computation which returns the result of the operation createUsersWithArrayInput body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either CreateUsersWithArrayInputResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUsersWithArrayInputResponseDefault | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) @@ -63,7 +63,7 @@ data CreateUsersWithArrayInputResponse = -- -- The same as 'createUsersWithArrayInput' but accepts an explicit configuration. createUsersWithArrayInputWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> [User] -- ^ The request body to send + -> GHC.Base.NonEmpty User -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response CreateUsersWithArrayInputResponse) -- ^ Monadic computation which returns the result of the operation createUsersWithArrayInputWithConfiguration config body = GHC.Base.fmap (\response_1 -> GHC.Base.fmap (Data.Either.either CreateUsersWithArrayInputResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUsersWithArrayInputResponseDefault @@ -71,14 +71,14 @@ createUsersWithArrayInputWithConfiguration config -- | > POST /user/createWithArray -- -- The same as 'createUsersWithArrayInput' but returns the raw 'Data.ByteString.ByteString'. -createUsersWithArrayInputRaw :: forall m . OpenAPI.Common.MonadHTTP m => [User] -- ^ The request body to send +createUsersWithArrayInputRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Base.NonEmpty User -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation createUsersWithArrayInputRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /user/createWithArray -- -- The same as 'createUsersWithArrayInput' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. createUsersWithArrayInputWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> [User] -- ^ The request body to send + -> GHC.Base.NonEmpty User -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation createUsersWithArrayInputWithConfigurationRaw config body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithListInput.hs b/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithListInput.hs index 9416053..937b239 100644 --- a/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithListInput.hs +++ b/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithListInput.hs @@ -48,7 +48,7 @@ import OpenAPI.Types -- | > POST /user/createWithList -- -- -createUsersWithListInput :: forall m . OpenAPI.Common.MonadHTTP m => [User] -- ^ The request body to send +createUsersWithListInput :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Base.NonEmpty User -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response CreateUsersWithListInputResponse) -- ^ Monadic computation which returns the result of the operation createUsersWithListInput body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either CreateUsersWithListInputResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUsersWithListInputResponseDefault | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithList" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) @@ -63,7 +63,7 @@ data CreateUsersWithListInputResponse = -- -- The same as 'createUsersWithListInput' but accepts an explicit configuration. createUsersWithListInputWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> [User] -- ^ The request body to send + -> GHC.Base.NonEmpty User -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response CreateUsersWithListInputResponse) -- ^ Monadic computation which returns the result of the operation createUsersWithListInputWithConfiguration config body = GHC.Base.fmap (\response_1 -> GHC.Base.fmap (Data.Either.either CreateUsersWithListInputResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUsersWithListInputResponseDefault @@ -71,14 +71,14 @@ createUsersWithListInputWithConfiguration config -- | > POST /user/createWithList -- -- The same as 'createUsersWithListInput' but returns the raw 'Data.ByteString.ByteString'. -createUsersWithListInputRaw :: forall m . OpenAPI.Common.MonadHTTP m => [User] -- ^ The request body to send +createUsersWithListInputRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Base.NonEmpty User -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation createUsersWithListInputRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithList" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /user/createWithList -- -- The same as 'createUsersWithListInput' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. createUsersWithListInputWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> [User] -- ^ The request body to send + -> GHC.Base.NonEmpty User -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation createUsersWithListInputWithConfigurationRaw config body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithList" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON)