diff --git a/example/generatedCode/src/OpenAPI/Operations/AddPet.hs b/example/generatedCode/src/OpenAPI/Operations/AddPet.hs index 4562917..ff4e27c 100755 --- a/example/generatedCode/src/OpenAPI/Operations/AddPet.hs +++ b/example/generatedCode/src/OpenAPI/Operations/AddPet.hs @@ -60,17 +60,17 @@ import OpenAPI.Types -- addPet :: forall m . OpenAPI.Common.MonadHTTP m => Pet -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response AddPetResponse) -- ^ Monadic computation which returns the result of the operation -addPet body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either AddPetResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right AddPetResponse200 - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right AddPetResponse405 - | 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") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +addPet body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either AddPetResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right AddPetResponse200 + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right AddPetResponse405 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | Represents a response of the operation 'addPet'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'AddPetResponseError' is used. data AddPetResponse = - AddPetResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + AddPetResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | AddPetResponse200 -- ^ Success | AddPetResponse405 -- ^ Invalid input - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > POST /pet -- -- The same as 'addPet' but accepts an explicit configuration. @@ -78,15 +78,15 @@ addPetWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Comm -> Pet -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response AddPetResponse) -- ^ Monadic computation which returns the result of the operation addPetWithConfiguration config - body = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either AddPetResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right AddPetResponse200 - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right AddPetResponse405 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either AddPetResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right AddPetResponse200 + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right AddPetResponse405 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /pet -- -- The same as 'addPet' but returns the raw 'Data.ByteString.ByteString'. addPetRaw :: forall m . OpenAPI.Common.MonadHTTP m => Pet -- ^ 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 -addPetRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +addPetRaw body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /pet -- -- The same as 'addPet' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -94,4 +94,4 @@ addPetWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.C -> Pet -- ^ 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 addPetWithConfigurationRaw config - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/example/generatedCode/src/OpenAPI/Operations/CreateUser.hs b/example/generatedCode/src/OpenAPI/Operations/CreateUser.hs index 3a6a6e4..295ee8b 100755 --- a/example/generatedCode/src/OpenAPI/Operations/CreateUser.hs +++ b/example/generatedCode/src/OpenAPI/Operations/CreateUser.hs @@ -60,15 +60,15 @@ import OpenAPI.Types -- This can only be done by the logged in user. createUser :: forall m . OpenAPI.Common.MonadHTTP m => User -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response CreateUserResponse) -- ^ Monadic computation which returns the result of the operation -createUser body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either CreateUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUserResponseDefault - | 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" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +createUser body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either CreateUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right CreateUserResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | Represents a response of the operation 'createUser'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'CreateUserResponseError' is used. data CreateUserResponse = - CreateUserResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + CreateUserResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | CreateUserResponseDefault -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > POST /user -- -- The same as 'createUser' but accepts an explicit configuration. @@ -76,14 +76,14 @@ createUserWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI. -> User -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response CreateUserResponse) -- ^ Monadic computation which returns the result of the operation createUserWithConfiguration config - body = GHC.Base.fmap (\response_1 -> GHC.Base.fmap (Data.Either.either CreateUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUserResponseDefault - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.fmap (\response_1 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either CreateUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right CreateUserResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /user -- -- The same as 'createUser' but returns the raw 'Data.ByteString.ByteString'. createUserRaw :: forall m . OpenAPI.Common.MonadHTTP m => 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 -createUserRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +createUserRaw body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /user -- -- The same as 'createUser' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -91,4 +91,4 @@ createUserWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenA -> 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 createUserWithConfigurationRaw config - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs b/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs index 1dd140a..5d060a1 100755 --- a/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs +++ b/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithArrayInput.hs @@ -60,15 +60,15 @@ import OpenAPI.Types -- createUsersWithArrayInput :: forall m . OpenAPI.Common.MonadHTTP m => [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) +createUsersWithArrayInput body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either CreateUsersWithArrayInputResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right CreateUsersWithArrayInputResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | Represents a response of the operation 'createUsersWithArrayInput'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'CreateUsersWithArrayInputResponseError' is used. data CreateUsersWithArrayInputResponse = - CreateUsersWithArrayInputResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + CreateUsersWithArrayInputResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | CreateUsersWithArrayInputResponseDefault -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > POST /user/createWithArray -- -- The same as 'createUsersWithArrayInput' but accepts an explicit configuration. @@ -76,14 +76,14 @@ createUsersWithArrayInputWithConfiguration :: forall m . OpenAPI.Common.MonadHTT -> [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 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_1) response_1) (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) + body = GHC.Internal.Base.fmap (\response_1 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either CreateUsersWithArrayInputResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right CreateUsersWithArrayInputResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > 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 -> 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) +createUsersWithArrayInputRaw body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Internal.Base.mempty (GHC.Internal.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'. @@ -91,4 +91,4 @@ createUsersWithArrayInputWithConfigurationRaw :: forall m . OpenAPI.Common.Monad -> [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) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Internal.Base.mempty (GHC.Internal.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 18351a8..d2c0e0b 100755 --- a/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithListInput.hs +++ b/example/generatedCode/src/OpenAPI/Operations/CreateUsersWithListInput.hs @@ -60,15 +60,15 @@ import OpenAPI.Types -- createUsersWithListInput :: forall m . OpenAPI.Common.MonadHTTP m => [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) +createUsersWithListInput body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either CreateUsersWithListInputResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right CreateUsersWithListInputResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithList" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | Represents a response of the operation 'createUsersWithListInput'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'CreateUsersWithListInputResponseError' is used. data CreateUsersWithListInputResponse = - CreateUsersWithListInputResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + CreateUsersWithListInputResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | CreateUsersWithListInputResponseDefault -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > POST /user/createWithList -- -- The same as 'createUsersWithListInput' but accepts an explicit configuration. @@ -76,14 +76,14 @@ createUsersWithListInputWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP -> [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 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_1) response_1) (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) + body = GHC.Internal.Base.fmap (\response_1 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either CreateUsersWithListInputResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right CreateUsersWithListInputResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithList" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > 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 -> 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) +createUsersWithListInputRaw body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithList" GHC.Internal.Base.mempty (GHC.Internal.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'. @@ -91,4 +91,4 @@ createUsersWithListInputWithConfigurationRaw :: forall m . OpenAPI.Common.MonadH -> [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) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/user/createWithList" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/example/generatedCode/src/OpenAPI/Operations/DeleteOrder.hs b/example/generatedCode/src/OpenAPI/Operations/DeleteOrder.hs index 393c207..0e69f00 100755 --- a/example/generatedCode/src/OpenAPI/Operations/DeleteOrder.hs +++ b/example/generatedCode/src/OpenAPI/Operations/DeleteOrder.hs @@ -58,40 +58,40 @@ import OpenAPI.Types -- | > DELETE /store/order/{orderId} -- -- For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors -deleteOrder :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 +deleteOrder :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response DeleteOrderResponse) -- ^ Monadic computation which returns the result of the operation -deleteOrder orderId = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either DeleteOrderResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteOrderResponse400 - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteOrderResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) +deleteOrder orderId = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either DeleteOrderResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteOrderResponse400 + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteOrderResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'deleteOrder'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'DeleteOrderResponseError' is used. data DeleteOrderResponse = - DeleteOrderResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + DeleteOrderResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | DeleteOrderResponse400 -- ^ Invalid ID supplied | DeleteOrderResponse404 -- ^ Order not found - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > DELETE /store/order/{orderId} -- -- The same as 'deleteOrder' but accepts an explicit configuration. deleteOrderWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 + -> GHC.Internal.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 -> m (Network.HTTP.Client.Types.Response DeleteOrderResponse) -- ^ Monadic computation which returns the result of the operation deleteOrderWithConfiguration config - orderId = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either DeleteOrderResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteOrderResponse400 - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteOrderResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) + orderId = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either DeleteOrderResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteOrderResponse400 + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteOrderResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > DELETE /store/order/{orderId} -- -- The same as 'deleteOrder' but returns the raw 'Data.ByteString.ByteString'. -deleteOrderRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 +deleteOrderRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -deleteOrderRaw orderId = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) +deleteOrderRaw orderId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > DELETE /store/order/{orderId} -- -- The same as 'deleteOrder' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. deleteOrderWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 + -> GHC.Internal.Int.Int64 -- ^ orderId: ID of the order that needs to be deleted | Constraints: Minimum of 1.0 -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation deleteOrderWithConfigurationRaw config - orderId = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) + orderId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/DeletePet.hs b/example/generatedCode/src/OpenAPI/Operations/DeletePet.hs index bf8b3ac..7a30511 100755 --- a/example/generatedCode/src/OpenAPI/Operations/DeletePet.hs +++ b/example/generatedCode/src/OpenAPI/Operations/DeletePet.hs @@ -58,40 +58,40 @@ import OpenAPI.Types -- | > DELETE /pet/{petId} -- -- -deletePet :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: Pet id to delete +deletePet :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: Pet id to delete -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response DeletePetResponse) -- ^ Monadic computation which returns the result of the operation -deletePet petId = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either DeletePetResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeletePetResponse400 - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeletePetResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) +deletePet petId = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either DeletePetResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeletePetResponse400 + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeletePetResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'deletePet'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'DeletePetResponseError' is used. data DeletePetResponse = - DeletePetResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + DeletePetResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | DeletePetResponse400 -- ^ Invalid ID supplied | DeletePetResponse404 -- ^ Pet not found - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > DELETE /pet/{petId} -- -- The same as 'deletePet' but accepts an explicit configuration. deletePetWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: Pet id to delete + -> GHC.Internal.Int.Int64 -- ^ petId: Pet id to delete -> m (Network.HTTP.Client.Types.Response DeletePetResponse) -- ^ Monadic computation which returns the result of the operation deletePetWithConfiguration config - petId = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either DeletePetResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeletePetResponse400 - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeletePetResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) + petId = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either DeletePetResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeletePetResponse400 + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeletePetResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > DELETE /pet/{petId} -- -- The same as 'deletePet' but returns the raw 'Data.ByteString.ByteString'. -deletePetRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: Pet id to delete +deletePetRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: Pet id to delete -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -deletePetRaw petId = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) +deletePetRaw petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > DELETE /pet/{petId} -- -- The same as 'deletePet' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. deletePetWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: Pet id to delete + -> GHC.Internal.Int.Int64 -- ^ petId: Pet id to delete -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation deletePetWithConfigurationRaw config - petId = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) + petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/DeleteUser.hs b/example/generatedCode/src/OpenAPI/Operations/DeleteUser.hs index 5a7d835..6dbc3d6 100755 --- a/example/generatedCode/src/OpenAPI/Operations/DeleteUser.hs +++ b/example/generatedCode/src/OpenAPI/Operations/DeleteUser.hs @@ -60,17 +60,17 @@ import OpenAPI.Types -- This can only be done by the logged in user. deleteUser :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Text -- ^ username: The name that needs to be deleted -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response DeleteUserResponse) -- ^ Monadic computation which returns the result of the operation -deleteUser username = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either DeleteUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteUserResponse400 - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteUserResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) +deleteUser username = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either DeleteUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteUserResponse400 + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteUserResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'deleteUser'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'DeleteUserResponseError' is used. data DeleteUserResponse = - DeleteUserResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + DeleteUserResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | DeleteUserResponse400 -- ^ Invalid username supplied | DeleteUserResponse404 -- ^ User not found - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > DELETE /user/{username} -- -- The same as 'deleteUser' but accepts an explicit configuration. @@ -78,15 +78,15 @@ deleteUserWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI. -> Data.Text.Internal.Text -- ^ username: The name that needs to be deleted -> m (Network.HTTP.Client.Types.Response DeleteUserResponse) -- ^ Monadic computation which returns the result of the operation deleteUserWithConfiguration config - username = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either DeleteUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteUserResponse400 - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right DeleteUserResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) + username = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either DeleteUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteUserResponse400 + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right DeleteUserResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > DELETE /user/{username} -- -- The same as 'deleteUser' but returns the raw 'Data.ByteString.ByteString'. deleteUserRaw :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Text -- ^ username: The name that needs to be deleted -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -deleteUserRaw username = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) +deleteUserRaw username = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > DELETE /user/{username} -- -- The same as 'deleteUser' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -94,4 +94,4 @@ deleteUserWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenA -> Data.Text.Internal.Text -- ^ username: The name that needs to be deleted -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation deleteUserWithConfigurationRaw config - username = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) + username = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "DELETE") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/FindPetsByStatus.hs b/example/generatedCode/src/OpenAPI/Operations/FindPetsByStatus.hs index 059a1e4..0ce92fe 100755 --- a/example/generatedCode/src/OpenAPI/Operations/FindPetsByStatus.hs +++ b/example/generatedCode/src/OpenAPI/Operations/FindPetsByStatus.hs @@ -60,10 +60,10 @@ import OpenAPI.Types -- Multiple status values can be provided with comma separated strings findPetsByStatus :: forall m . OpenAPI.Common.MonadHTTP m => [FindPetsByStatusParametersStatus] -- ^ status: Status values that need to be considered for filter -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response FindPetsByStatusResponse) -- ^ Monadic computation which returns the result of the operation -findPetsByStatus status = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either FindPetsByStatusResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByStatusResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - [Pet]) - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right FindPetsByStatusResponse400 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) +findPetsByStatus status = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either FindPetsByStatusResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByStatusResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + [Pet]) + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right FindPetsByStatusResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) -- | Defines the enum schema located at @paths.\/pet\/findByStatus.GET.parameters.[0].schema.items@ in the specification. -- -- @@ -73,7 +73,7 @@ data FindPetsByStatusParametersStatus = | FindPetsByStatusParametersStatusEnumAvailable -- ^ Represents the JSON value @"available"@ | FindPetsByStatusParametersStatusEnumPending -- ^ Represents the JSON value @"pending"@ | FindPetsByStatusParametersStatusEnumSold -- ^ Represents the JSON value @"sold"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON FindPetsByStatusParametersStatus where {toJSON (FindPetsByStatusParametersStatusOther val) = val; toJSON (FindPetsByStatusParametersStatusTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -81,18 +81,18 @@ instance Data.Aeson.Types.ToJSON.ToJSON FindPetsByStatusParametersStatus toJSON (FindPetsByStatusParametersStatusEnumPending) = "pending"; toJSON (FindPetsByStatusParametersStatusEnumSold) = "sold"} instance Data.Aeson.Types.FromJSON.FromJSON FindPetsByStatusParametersStatus - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "available" -> FindPetsByStatusParametersStatusEnumAvailable - | val GHC.Classes.== "pending" -> FindPetsByStatusParametersStatusEnumPending - | val GHC.Classes.== "sold" -> FindPetsByStatusParametersStatusEnumSold - | GHC.Base.otherwise -> FindPetsByStatusParametersStatusOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "available" -> FindPetsByStatusParametersStatusEnumAvailable + | val GHC.Classes.== "pending" -> FindPetsByStatusParametersStatusEnumPending + | val GHC.Classes.== "sold" -> FindPetsByStatusParametersStatusEnumSold + | GHC.Internal.Base.otherwise -> FindPetsByStatusParametersStatusOther val)} -- | Represents a response of the operation 'findPetsByStatus'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'FindPetsByStatusResponseError' is used. data FindPetsByStatusResponse = - FindPetsByStatusResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + FindPetsByStatusResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | FindPetsByStatusResponse200 [Pet] -- ^ successful operation | FindPetsByStatusResponse400 -- ^ Invalid status value - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/findByStatus -- -- The same as 'findPetsByStatus' but accepts an explicit configuration. @@ -100,16 +100,16 @@ findPetsByStatusWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => Op -> [FindPetsByStatusParametersStatus] -- ^ status: Status values that need to be considered for filter -> m (Network.HTTP.Client.Types.Response FindPetsByStatusResponse) -- ^ Monadic computation which returns the result of the operation findPetsByStatusWithConfiguration config - status = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either FindPetsByStatusResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByStatusResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - [Pet]) - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right FindPetsByStatusResponse400 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) + status = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either FindPetsByStatusResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByStatusResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + [Pet]) + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right FindPetsByStatusResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) -- | > GET /pet/findByStatus -- -- The same as 'findPetsByStatus' but returns the raw 'Data.ByteString.ByteString'. findPetsByStatusRaw :: forall m . OpenAPI.Common.MonadHTTP m => [FindPetsByStatusParametersStatus] -- ^ status: Status values that need to be considered for filter -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -findPetsByStatusRaw status = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) +findPetsByStatusRaw status = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) -- | > GET /pet/findByStatus -- -- The same as 'findPetsByStatus' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -117,4 +117,4 @@ findPetsByStatusWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => -> [FindPetsByStatusParametersStatus] -- ^ status: Status values that need to be considered for filter -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation findPetsByStatusWithConfigurationRaw config - status = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) + status = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByStatus" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.True]) diff --git a/example/generatedCode/src/OpenAPI/Operations/FindPetsByTags.hs b/example/generatedCode/src/OpenAPI/Operations/FindPetsByTags.hs index 0a73b9a..a333efd 100755 --- a/example/generatedCode/src/OpenAPI/Operations/FindPetsByTags.hs +++ b/example/generatedCode/src/OpenAPI/Operations/FindPetsByTags.hs @@ -60,18 +60,18 @@ import OpenAPI.Types -- Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. findPetsByTags :: forall m . OpenAPI.Common.MonadHTTP m => [Data.Text.Internal.Text] -- ^ tags: Tags to filter by -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response FindPetsByTagsResponse) -- ^ Monadic computation which returns the result of the operation -findPetsByTags tags = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either FindPetsByTagsResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByTagsResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - [Pet]) - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right FindPetsByTagsResponse400 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) +findPetsByTags tags = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either FindPetsByTagsResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByTagsResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + [Pet]) + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right FindPetsByTagsResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) -- | Represents a response of the operation 'findPetsByTags'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'FindPetsByTagsResponseError' is used. data FindPetsByTagsResponse = - FindPetsByTagsResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + FindPetsByTagsResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | FindPetsByTagsResponse200 [Pet] -- ^ successful operation | FindPetsByTagsResponse400 -- ^ Invalid tag value - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/findByTags -- -- The same as 'findPetsByTags' but accepts an explicit configuration. @@ -79,16 +79,16 @@ findPetsByTagsWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => Open -> [Data.Text.Internal.Text] -- ^ tags: Tags to filter by -> m (Network.HTTP.Client.Types.Response FindPetsByTagsResponse) -- ^ Monadic computation which returns the result of the operation findPetsByTagsWithConfiguration config - tags = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either FindPetsByTagsResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByTagsResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - [Pet]) - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right FindPetsByTagsResponse400 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) + tags = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either FindPetsByTagsResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> FindPetsByTagsResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + [Pet]) + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right FindPetsByTagsResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) -- | > GET /pet/findByTags -- -- The same as 'findPetsByTags' but returns the raw 'Data.ByteString.ByteString'. findPetsByTagsRaw :: forall m . OpenAPI.Common.MonadHTTP m => [Data.Text.Internal.Text] -- ^ tags: Tags to filter by -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -findPetsByTagsRaw tags = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) +findPetsByTagsRaw tags = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) -- | > GET /pet/findByTags -- -- The same as 'findPetsByTags' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -96,4 +96,4 @@ findPetsByTagsWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => O -> [Data.Text.Internal.Text] -- ^ tags: Tags to filter by -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation findPetsByTagsWithConfigurationRaw config - tags = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) + tags = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/findByTags" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "tags") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON tags) (Data.Text.Internal.pack "form") GHC.Types.True]) diff --git a/example/generatedCode/src/OpenAPI/Operations/GetInventory.hs b/example/generatedCode/src/OpenAPI/Operations/GetInventory.hs index 66f2365..3d6d480 100755 --- a/example/generatedCode/src/OpenAPI/Operations/GetInventory.hs +++ b/example/generatedCode/src/OpenAPI/Operations/GetInventory.hs @@ -59,32 +59,32 @@ import OpenAPI.Types -- -- Returns a map of status codes to quantities getInventory :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response GetInventoryResponse) -- ^ Monadic computation which returns the result of the operation -getInventory = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either GetInventoryResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetInventoryResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Data.Aeson.Types.Internal.Object) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Base.mempty) +getInventory = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetInventoryResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetInventoryResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Data.Aeson.Types.Internal.Object) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Internal.Base.mempty) -- | Represents a response of the operation 'getInventory'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'GetInventoryResponseError' is used. data GetInventoryResponse = - GetInventoryResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + GetInventoryResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | GetInventoryResponse200 Data.Aeson.Types.Internal.Object -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /store/inventory -- -- The same as 'getInventory' but accepts an explicit configuration. getInventoryWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request -> m (Network.HTTP.Client.Types.Response GetInventoryResponse) -- ^ Monadic computation which returns the result of the operation -getInventoryWithConfiguration config = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either GetInventoryResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetInventoryResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Data.Aeson.Types.Internal.Object) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Base.mempty) +getInventoryWithConfiguration config = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetInventoryResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetInventoryResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Data.Aeson.Types.Internal.Object) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Internal.Base.mempty) -- | > GET /store/inventory -- -- The same as 'getInventory' but returns the raw 'Data.ByteString.ByteString'. getInventoryRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -getInventoryRaw = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Base.mempty) +getInventoryRaw = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Internal.Base.mempty) -- | > GET /store/inventory -- -- The same as 'getInventory' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. getInventoryWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -getInventoryWithConfigurationRaw config = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Base.mempty) +getInventoryWithConfigurationRaw config = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/store/inventory" GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/GetOrderById.hs b/example/generatedCode/src/OpenAPI/Operations/GetOrderById.hs index 5f3eb59..bd1bda7 100755 --- a/example/generatedCode/src/OpenAPI/Operations/GetOrderById.hs +++ b/example/generatedCode/src/OpenAPI/Operations/GetOrderById.hs @@ -58,45 +58,45 @@ import OpenAPI.Types -- | > GET /store/order/{orderId} -- -- For valid response try integer IDs with value >= 1 and \<= 10. Other values will generated exceptions -getOrderById :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 +getOrderById :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response GetOrderByIdResponse) -- ^ Monadic computation which returns the result of the operation -getOrderById orderId = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either GetOrderByIdResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetOrderByIdResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Order) - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetOrderByIdResponse400 - | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetOrderByIdResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) +getOrderById orderId = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetOrderByIdResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetOrderByIdResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Order) + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetOrderByIdResponse400 + | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetOrderByIdResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'getOrderById'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'GetOrderByIdResponseError' is used. data GetOrderByIdResponse = - GetOrderByIdResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + GetOrderByIdResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | GetOrderByIdResponse200 Order -- ^ successful operation | GetOrderByIdResponse400 -- ^ Invalid ID supplied | GetOrderByIdResponse404 -- ^ Order not found - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /store/order/{orderId} -- -- The same as 'getOrderById' but accepts an explicit configuration. getOrderByIdWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 + -> GHC.Internal.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 -> m (Network.HTTP.Client.Types.Response GetOrderByIdResponse) -- ^ Monadic computation which returns the result of the operation getOrderByIdWithConfiguration config - orderId = GHC.Base.fmap (\response_4 -> GHC.Base.fmap (Data.Either.either GetOrderByIdResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetOrderByIdResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Order) - | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetOrderByIdResponse400 - | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetOrderByIdResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) + orderId = GHC.Internal.Base.fmap (\response_4 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetOrderByIdResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetOrderByIdResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Order) + | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetOrderByIdResponse400 + | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetOrderByIdResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /store/order/{orderId} -- -- The same as 'getOrderById' but returns the raw 'Data.ByteString.ByteString'. -getOrderByIdRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 +getOrderByIdRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -getOrderByIdRaw orderId = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) +getOrderByIdRaw orderId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /store/order/{orderId} -- -- The same as 'getOrderById' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. getOrderByIdWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 + -> GHC.Internal.Int.Int64 -- ^ orderId: ID of pet that needs to be fetched | Constraints: Maxium of 10.0, Minimum of 1.0 -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation getOrderByIdWithConfigurationRaw config - orderId = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Base.<> "")) GHC.Base.mempty) + orderId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/store/order/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel orderId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/GetPetById.hs b/example/generatedCode/src/OpenAPI/Operations/GetPetById.hs index bb72dc8..9dffa0d 100755 --- a/example/generatedCode/src/OpenAPI/Operations/GetPetById.hs +++ b/example/generatedCode/src/OpenAPI/Operations/GetPetById.hs @@ -58,45 +58,45 @@ import OpenAPI.Types -- | > GET /pet/{petId} -- -- Returns a single pet -getPetById :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: ID of pet to return +getPetById :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: ID of pet to return -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response GetPetByIdResponse) -- ^ Monadic computation which returns the result of the operation -getPetById petId = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either GetPetByIdResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetPetByIdResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Pet) - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetPetByIdResponse400 - | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetPetByIdResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) +getPetById petId = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetPetByIdResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetPetByIdResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Pet) + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetPetByIdResponse400 + | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetPetByIdResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'getPetById'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'GetPetByIdResponseError' is used. data GetPetByIdResponse = - GetPetByIdResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + GetPetByIdResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | GetPetByIdResponse200 Pet -- ^ successful operation | GetPetByIdResponse400 -- ^ Invalid ID supplied | GetPetByIdResponse404 -- ^ Pet not found - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/{petId} -- -- The same as 'getPetById' but accepts an explicit configuration. getPetByIdWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: ID of pet to return + -> GHC.Internal.Int.Int64 -- ^ petId: ID of pet to return -> m (Network.HTTP.Client.Types.Response GetPetByIdResponse) -- ^ Monadic computation which returns the result of the operation getPetByIdWithConfiguration config - petId = GHC.Base.fmap (\response_4 -> GHC.Base.fmap (Data.Either.either GetPetByIdResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetPetByIdResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Pet) - | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetPetByIdResponse400 - | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetPetByIdResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) + petId = GHC.Internal.Base.fmap (\response_4 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetPetByIdResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetPetByIdResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Pet) + | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetPetByIdResponse400 + | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetPetByIdResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /pet/{petId} -- -- The same as 'getPetById' but returns the raw 'Data.ByteString.ByteString'. -getPetByIdRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: ID of pet to return +getPetByIdRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: ID of pet to return -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -getPetByIdRaw petId = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) +getPetByIdRaw petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /pet/{petId} -- -- The same as 'getPetById' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. getPetByIdWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: ID of pet to return + -> GHC.Internal.Int.Int64 -- ^ petId: ID of pet to return -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation getPetByIdWithConfigurationRaw config - petId = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) + petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/GetUserByName.hs b/example/generatedCode/src/OpenAPI/Operations/GetUserByName.hs index 2dca46d..559de25 100755 --- a/example/generatedCode/src/OpenAPI/Operations/GetUserByName.hs +++ b/example/generatedCode/src/OpenAPI/Operations/GetUserByName.hs @@ -60,20 +60,20 @@ import OpenAPI.Types -- getUserByName :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Text -- ^ username: The name that needs to be fetched. Use user1 for testing. -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response GetUserByNameResponse) -- ^ Monadic computation which returns the result of the operation -getUserByName username = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either GetUserByNameResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetUserByNameResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - User) - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetUserByNameResponse400 - | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetUserByNameResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) +getUserByName username = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetUserByNameResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetUserByNameResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + User) + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetUserByNameResponse400 + | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetUserByNameResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'getUserByName'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'GetUserByNameResponseError' is used. data GetUserByNameResponse = - GetUserByNameResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + GetUserByNameResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | GetUserByNameResponse200 User -- ^ successful operation | GetUserByNameResponse400 -- ^ Invalid username supplied | GetUserByNameResponse404 -- ^ User not found - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /user/{username} -- -- The same as 'getUserByName' but accepts an explicit configuration. @@ -81,17 +81,17 @@ getUserByNameWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenA -> Data.Text.Internal.Text -- ^ username: The name that needs to be fetched. Use user1 for testing. -> m (Network.HTTP.Client.Types.Response GetUserByNameResponse) -- ^ Monadic computation which returns the result of the operation getUserByNameWithConfiguration config - username = GHC.Base.fmap (\response_4 -> GHC.Base.fmap (Data.Either.either GetUserByNameResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetUserByNameResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - User) - | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetUserByNameResponse400 - | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right GetUserByNameResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) + username = GHC.Internal.Base.fmap (\response_4 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either GetUserByNameResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GetUserByNameResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + User) + | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetUserByNameResponse400 + | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right GetUserByNameResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /user/{username} -- -- The same as 'getUserByName' but returns the raw 'Data.ByteString.ByteString'. getUserByNameRaw :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Text -- ^ username: The name that needs to be fetched. Use user1 for testing. -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -getUserByNameRaw username = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) +getUserByNameRaw username = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /user/{username} -- -- The same as 'getUserByName' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -99,4 +99,4 @@ getUserByNameWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => Op -> Data.Text.Internal.Text -- ^ username: The name that needs to be fetched. Use user1 for testing. -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation getUserByNameWithConfigurationRaw config - username = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty) + username = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/LoginUser.hs b/example/generatedCode/src/OpenAPI/Operations/LoginUser.hs index 67bd5fa..4621852 100755 --- a/example/generatedCode/src/OpenAPI/Operations/LoginUser.hs +++ b/example/generatedCode/src/OpenAPI/Operations/LoginUser.hs @@ -60,11 +60,11 @@ import OpenAPI.Types -- loginUser :: forall m . OpenAPI.Common.MonadHTTP m => LoginUserParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response LoginUserResponse) -- ^ Monadic computation which returns the result of the operation -loginUser parameters = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either LoginUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> LoginUserResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Data.Text.Internal.Text) - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right LoginUserResponse400 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) +loginUser parameters = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either LoginUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> LoginUserResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Data.Text.Internal.Text) + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right LoginUserResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | Defines the object schema located at @paths.\/user\/login.GET.parameters@ in the specification. -- -- @@ -77,13 +77,13 @@ data LoginUserParameters = LoginUserParameters { -- -- The user name for login , loginUserParametersQueryUsername :: Data.Text.Internal.Text - } deriving (GHC.Show.Show + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LoginUserParameters - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["queryPassword" Data.Aeson.Types.ToJSON..= loginUserParametersQueryPassword obj] : ["queryUsername" Data.Aeson.Types.ToJSON..= loginUserParametersQueryUsername obj] : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["queryPassword" Data.Aeson.Types.ToJSON..= loginUserParametersQueryPassword obj] : ["queryUsername" Data.Aeson.Types.ToJSON..= loginUserParametersQueryUsername obj] : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["queryPassword" Data.Aeson.Types.ToJSON..= loginUserParametersQueryPassword obj] : ["queryUsername" Data.Aeson.Types.ToJSON..= loginUserParametersQueryUsername obj] : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["queryPassword" Data.Aeson.Types.ToJSON..= loginUserParametersQueryPassword obj] : ["queryUsername" Data.Aeson.Types.ToJSON..= loginUserParametersQueryUsername obj] : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON LoginUserParameters - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "LoginUserParameters" (\obj -> (GHC.Base.pure LoginUserParameters GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryPassword")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryUsername"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "LoginUserParameters" (\obj -> (GHC.Internal.Base.pure LoginUserParameters GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryPassword")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryUsername"))} -- | Create a new 'LoginUserParameters' with all required fields. mkLoginUserParameters :: Data.Text.Internal.Text -- ^ 'loginUserParametersQueryPassword' -> Data.Text.Internal.Text -- ^ 'loginUserParametersQueryUsername' @@ -94,10 +94,10 @@ mkLoginUserParameters loginUserParametersQueryPassword loginUserParametersQueryU -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'LoginUserResponseError' is used. data LoginUserResponse = - LoginUserResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + LoginUserResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | LoginUserResponse200 Data.Text.Internal.Text -- ^ successful operation | LoginUserResponse400 -- ^ Invalid username\/password supplied - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /user/login -- -- The same as 'loginUser' but accepts an explicit configuration. @@ -105,18 +105,18 @@ loginUserWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.C -> LoginUserParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> m (Network.HTTP.Client.Types.Response LoginUserResponse) -- ^ Monadic computation which returns the result of the operation loginUserWithConfiguration config - parameters = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either LoginUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> LoginUserResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Data.Text.Internal.Text) - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right LoginUserResponse400 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) + parameters = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either LoginUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> LoginUserResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Data.Text.Internal.Text) + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right LoginUserResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /user/login -- -- The same as 'loginUser' but returns the raw 'Data.ByteString.ByteString'. loginUserRaw :: forall m . OpenAPI.Common.MonadHTTP m => LoginUserParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -loginUserRaw parameters = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) +loginUserRaw parameters = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /user/login -- -- The same as 'loginUser' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -124,5 +124,5 @@ loginUserWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAP -> LoginUserParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation loginUserWithConfigurationRaw config - parameters = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) + parameters = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/login" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "username") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryUsername parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "password") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (loginUserParametersQueryPassword parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) diff --git a/example/generatedCode/src/OpenAPI/Operations/LogoutUser.hs b/example/generatedCode/src/OpenAPI/Operations/LogoutUser.hs index 2fc932f..4ddbb38 100755 --- a/example/generatedCode/src/OpenAPI/Operations/LogoutUser.hs +++ b/example/generatedCode/src/OpenAPI/Operations/LogoutUser.hs @@ -59,30 +59,30 @@ import OpenAPI.Types -- -- logoutUser :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response LogoutUserResponse) -- ^ Monadic computation which returns the result of the operation -logoutUser = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either LogoutUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right LogoutUserResponseDefault - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Base.mempty) +logoutUser = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either LogoutUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right LogoutUserResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Internal.Base.mempty) -- | Represents a response of the operation 'logoutUser'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'LogoutUserResponseError' is used. data LogoutUserResponse = - LogoutUserResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + LogoutUserResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | LogoutUserResponseDefault -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /user/logout -- -- The same as 'logoutUser' but accepts an explicit configuration. logoutUserWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request -> m (Network.HTTP.Client.Types.Response LogoutUserResponse) -- ^ Monadic computation which returns the result of the operation -logoutUserWithConfiguration config = GHC.Base.fmap (\response_1 -> GHC.Base.fmap (Data.Either.either LogoutUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right LogoutUserResponseDefault - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Base.mempty) +logoutUserWithConfiguration config = GHC.Internal.Base.fmap (\response_1 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either LogoutUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right LogoutUserResponseDefault + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Internal.Base.mempty) -- | > GET /user/logout -- -- The same as 'logoutUser' but returns the raw 'Data.ByteString.ByteString'. logoutUserRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -logoutUserRaw = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Base.mempty) +logoutUserRaw = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Internal.Base.mempty) -- | > GET /user/logout -- -- The same as 'logoutUser' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. logoutUserWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -logoutUserWithConfigurationRaw config = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Base.mempty) +logoutUserWithConfigurationRaw config = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/user/logout" GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/Operations/PlaceOrder.hs b/example/generatedCode/src/OpenAPI/Operations/PlaceOrder.hs index 8c8d7e9..9e1906a 100755 --- a/example/generatedCode/src/OpenAPI/Operations/PlaceOrder.hs +++ b/example/generatedCode/src/OpenAPI/Operations/PlaceOrder.hs @@ -60,18 +60,18 @@ import OpenAPI.Types -- placeOrder :: forall m . OpenAPI.Common.MonadHTTP m => Order -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PlaceOrderResponse) -- ^ Monadic computation which returns the result of the operation -placeOrder body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either PlaceOrderResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> PlaceOrderResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Order) - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right PlaceOrderResponse400 - | 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") "/store/order" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +placeOrder body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either PlaceOrderResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> PlaceOrderResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Order) + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right PlaceOrderResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/store/order" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | Represents a response of the operation 'placeOrder'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'PlaceOrderResponseError' is used. data PlaceOrderResponse = - PlaceOrderResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + PlaceOrderResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | PlaceOrderResponse200 Order -- ^ successful operation | PlaceOrderResponse400 -- ^ Invalid Order - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > POST /store/order -- -- The same as 'placeOrder' but accepts an explicit configuration. @@ -79,16 +79,16 @@ placeOrderWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI. -> Order -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response PlaceOrderResponse) -- ^ Monadic computation which returns the result of the operation placeOrderWithConfiguration config - body = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either PlaceOrderResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> PlaceOrderResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Order) - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right PlaceOrderResponse400 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/store/order" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either PlaceOrderResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> PlaceOrderResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Order) + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right PlaceOrderResponse400 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/store/order" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /store/order -- -- The same as 'placeOrder' but returns the raw 'Data.ByteString.ByteString'. placeOrderRaw :: forall m . OpenAPI.Common.MonadHTTP m => Order -- ^ 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 -placeOrderRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/store/order" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +placeOrderRaw body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/store/order" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > POST /store/order -- -- The same as 'placeOrder' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -96,4 +96,4 @@ placeOrderWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenA -> Order -- ^ 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 placeOrderWithConfigurationRaw config - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/store/order" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") "/store/order" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/example/generatedCode/src/OpenAPI/Operations/UpdatePet.hs b/example/generatedCode/src/OpenAPI/Operations/UpdatePet.hs index 4f47a13..8587b98 100755 --- a/example/generatedCode/src/OpenAPI/Operations/UpdatePet.hs +++ b/example/generatedCode/src/OpenAPI/Operations/UpdatePet.hs @@ -60,19 +60,19 @@ import OpenAPI.Types -- updatePet :: forall m . OpenAPI.Common.MonadHTTP m => Pet -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response UpdatePetResponse) -- ^ Monadic computation which returns the result of the operation -updatePet body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either UpdatePetResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetResponse400 - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetResponse404 - | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetResponse405 - | 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 "PUT") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +updatePet body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UpdatePetResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetResponse400 + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetResponse404 + | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetResponse405 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | Represents a response of the operation 'updatePet'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'UpdatePetResponseError' is used. data UpdatePetResponse = - UpdatePetResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + UpdatePetResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | UpdatePetResponse400 -- ^ Invalid ID supplied | UpdatePetResponse404 -- ^ Pet not found | UpdatePetResponse405 -- ^ Validation exception - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > PUT /pet -- -- The same as 'updatePet' but accepts an explicit configuration. @@ -80,16 +80,16 @@ updatePetWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.C -> Pet -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response UpdatePetResponse) -- ^ Monadic computation which returns the result of the operation updatePetWithConfiguration config - body = GHC.Base.fmap (\response_4 -> GHC.Base.fmap (Data.Either.either UpdatePetResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetResponse400 - | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetResponse404 - | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetResponse405 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PUT") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.fmap (\response_4 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UpdatePetResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetResponse400 + | (\status_6 -> Network.HTTP.Types.Status.statusCode status_6 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetResponse404 + | (\status_7 -> Network.HTTP.Types.Status.statusCode status_7 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetResponse405 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_4) response_4) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > PUT /pet -- -- The same as 'updatePet' but returns the raw 'Data.ByteString.ByteString'. updatePetRaw :: forall m . OpenAPI.Common.MonadHTTP m => Pet -- ^ 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 -updatePetRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PUT") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) +updatePetRaw body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > PUT /pet -- -- The same as 'updatePet' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -97,4 +97,4 @@ updatePetWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAP -> Pet -- ^ 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 updatePetWithConfigurationRaw config - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PUT") "/pet" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") "/pet" GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/example/generatedCode/src/OpenAPI/Operations/UpdatePetWithForm.hs b/example/generatedCode/src/OpenAPI/Operations/UpdatePetWithForm.hs index 43db79e..4a6714d 100755 --- a/example/generatedCode/src/OpenAPI/Operations/UpdatePetWithForm.hs +++ b/example/generatedCode/src/OpenAPI/Operations/UpdatePetWithForm.hs @@ -58,64 +58,64 @@ import OpenAPI.Types -- | > POST /pet/{petId} -- -- -updatePetWithForm :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: ID of pet that needs to be updated - -> GHC.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ The request body to send +updatePetWithForm :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: ID of pet that needs to be updated + -> GHC.Internal.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response UpdatePetWithFormResponse) -- ^ Monadic computation which returns the result of the operation updatePetWithForm petId - body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either UpdatePetWithFormResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetWithFormResponse405 - | 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") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) + body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UpdatePetWithFormResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetWithFormResponse405 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/pet\/{petId}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. -- -- data UpdatePetWithFormRequestBody = UpdatePetWithFormRequestBody { -- | name: Updated name of the pet - updatePetWithFormRequestBodyName :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + updatePetWithFormRequestBodyName :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | status: Updated status of the pet - , updatePetWithFormRequestBodyStatus :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , updatePetWithFormRequestBodyStatus :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON UpdatePetWithFormRequestBody - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyStatus obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyStatus obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyName obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyStatus obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyName obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (updatePetWithFormRequestBodyStatus obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON UpdatePetWithFormRequestBody - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "UpdatePetWithFormRequestBody" (\obj -> (GHC.Base.pure UpdatePetWithFormRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "status"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "UpdatePetWithFormRequestBody" (\obj -> (GHC.Internal.Base.pure UpdatePetWithFormRequestBody GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "status"))} -- | Create a new 'UpdatePetWithFormRequestBody' with all required fields. mkUpdatePetWithFormRequestBody :: UpdatePetWithFormRequestBody -mkUpdatePetWithFormRequestBody = UpdatePetWithFormRequestBody{updatePetWithFormRequestBodyName = GHC.Maybe.Nothing, - updatePetWithFormRequestBodyStatus = GHC.Maybe.Nothing} +mkUpdatePetWithFormRequestBody = UpdatePetWithFormRequestBody{updatePetWithFormRequestBodyName = GHC.Internal.Maybe.Nothing, + updatePetWithFormRequestBodyStatus = GHC.Internal.Maybe.Nothing} -- | Represents a response of the operation 'updatePetWithForm'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'UpdatePetWithFormResponseError' is used. data UpdatePetWithFormResponse = - UpdatePetWithFormResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + UpdatePetWithFormResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | UpdatePetWithFormResponse405 -- ^ Invalid input - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > POST /pet/{petId} -- -- The same as 'updatePetWithForm' but accepts an explicit configuration. updatePetWithFormWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: ID of pet that needs to be updated - -> GHC.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ The request body to send + -> GHC.Internal.Int.Int64 -- ^ petId: ID of pet that needs to be updated + -> GHC.Internal.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response UpdatePetWithFormResponse) -- ^ Monadic computation which returns the result of the operation updatePetWithFormWithConfiguration config petId - body = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either UpdatePetWithFormResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdatePetWithFormResponse405 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) + body = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UpdatePetWithFormResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 405) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdatePetWithFormResponse405 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) -- | > POST /pet/{petId} -- -- The same as 'updatePetWithForm' but returns the raw 'Data.ByteString.ByteString'. -updatePetWithFormRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: ID of pet that needs to be updated - -> GHC.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ The request body to send +updatePetWithFormRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: ID of pet that needs to be updated + -> GHC.Internal.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ 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 updatePetWithFormRaw petId - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) -- | > POST /pet/{petId} -- -- The same as 'updatePetWithForm' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. updatePetWithFormWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: ID of pet that needs to be updated - -> GHC.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ The request body to send + -> GHC.Internal.Int.Int64 -- ^ petId: ID of pet that needs to be updated + -> GHC.Internal.Maybe.Maybe UpdatePetWithFormRequestBody -- ^ 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 updatePetWithFormWithConfigurationRaw config petId - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingFormData) diff --git a/example/generatedCode/src/OpenAPI/Operations/UpdateUser.hs b/example/generatedCode/src/OpenAPI/Operations/UpdateUser.hs index ce7908d..52c8790 100755 --- a/example/generatedCode/src/OpenAPI/Operations/UpdateUser.hs +++ b/example/generatedCode/src/OpenAPI/Operations/UpdateUser.hs @@ -62,17 +62,17 @@ updateUser :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Text - -> User -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response UpdateUserResponse) -- ^ Monadic computation which returns the result of the operation updateUser username - body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either UpdateUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdateUserResponse400 - | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdateUserResponse404 - | 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 "PUT") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UpdateUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdateUserResponse400 + | (\status_2 -> Network.HTTP.Types.Status.statusCode status_2 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdateUserResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | Represents a response of the operation 'updateUser'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'UpdateUserResponseError' is used. data UpdateUserResponse = - UpdateUserResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + UpdateUserResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | UpdateUserResponse400 -- ^ Invalid user supplied | UpdateUserResponse404 -- ^ User not found - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > PUT /user/{username} -- -- The same as 'updateUser' but accepts an explicit configuration. @@ -82,9 +82,9 @@ updateUserWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI. -> m (Network.HTTP.Client.Types.Response UpdateUserResponse) -- ^ Monadic computation which returns the result of the operation updateUserWithConfiguration config username - body = GHC.Base.fmap (\response_3 -> GHC.Base.fmap (Data.Either.either UpdateUserResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdateUserResponse400 - | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right UpdateUserResponse404 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PUT") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.fmap (\response_3 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UpdateUserResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_4 -> Network.HTTP.Types.Status.statusCode status_4 GHC.Classes.== 400) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdateUserResponse400 + | (\status_5 -> Network.HTTP.Types.Status.statusCode status_5 GHC.Classes.== 404) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right UpdateUserResponse404 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_3) response_3) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > PUT /user/{username} -- -- The same as 'updateUser' but returns the raw 'Data.ByteString.ByteString'. @@ -92,7 +92,7 @@ updateUserRaw :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Tex -> 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 updateUserRaw username - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PUT") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) -- | > PUT /user/{username} -- -- The same as 'updateUser' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -102,4 +102,4 @@ updateUserWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenA -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation updateUserWithConfigurationRaw config username - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PUT") ("/user/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Base.<> "")) GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PUT") ("/user/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel username)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty (GHC.Internal.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/example/generatedCode/src/OpenAPI/Operations/UploadFile.hs b/example/generatedCode/src/OpenAPI/Operations/UploadFile.hs index 3358607..065150f 100755 --- a/example/generatedCode/src/OpenAPI/Operations/UploadFile.hs +++ b/example/generatedCode/src/OpenAPI/Operations/UploadFile.hs @@ -58,39 +58,39 @@ import OpenAPI.Types -- | > POST /pet/{petId}/uploadImage -- -- -uploadFile :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: ID of pet to update +uploadFile :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: ID of pet to update -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response UploadFileResponse) -- ^ Monadic computation which returns the result of the operation -uploadFile petId = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either UploadFileResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> UploadFileResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - ApiResponse) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "/uploadImage")) GHC.Base.mempty) +uploadFile petId = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UploadFileResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> UploadFileResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + ApiResponse) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "/uploadImage")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'uploadFile'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'UploadFileResponseError' is used. data UploadFileResponse = - UploadFileResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + UploadFileResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | UploadFileResponse200 ApiResponse -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > POST /pet/{petId}/uploadImage -- -- The same as 'uploadFile' but accepts an explicit configuration. uploadFileWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: ID of pet to update + -> GHC.Internal.Int.Int64 -- ^ petId: ID of pet to update -> m (Network.HTTP.Client.Types.Response UploadFileResponse) -- ^ Monadic computation which returns the result of the operation uploadFileWithConfiguration config - petId = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either UploadFileResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> UploadFileResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - ApiResponse) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "/uploadImage")) GHC.Base.mempty) + petId = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either UploadFileResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> UploadFileResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + ApiResponse) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "/uploadImage")) GHC.Internal.Base.mempty) -- | > POST /pet/{petId}/uploadImage -- -- The same as 'uploadFile' but returns the raw 'Data.ByteString.ByteString'. -uploadFileRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Int.Int64 -- ^ petId: ID of pet to update +uploadFileRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Int.Int64 -- ^ petId: ID of pet to update -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -uploadFileRaw petId = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "/uploadImage")) GHC.Base.mempty) +uploadFileRaw petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "/uploadImage")) GHC.Internal.Base.mempty) -- | > POST /pet/{petId}/uploadImage -- -- The same as 'uploadFile' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. uploadFileWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Int.Int64 -- ^ petId: ID of pet to update + -> GHC.Internal.Int.Int64 -- ^ petId: ID of pet to update -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation uploadFileWithConfigurationRaw config - petId = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "/uploadImage")) GHC.Base.mempty) + petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "POST") ("/pet/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "/uploadImage")) GHC.Internal.Base.mempty) diff --git a/example/generatedCode/src/OpenAPI/SecuritySchemes.hs b/example/generatedCode/src/OpenAPI/SecuritySchemes.hs index 3faa891..f75a00f 100755 --- a/example/generatedCode/src/OpenAPI/SecuritySchemes.hs +++ b/example/generatedCode/src/OpenAPI/SecuritySchemes.hs @@ -26,13 +26,13 @@ import qualified OpenAPI.Common -- @ apiKeyInHeaderAuthenticationSecurityScheme :: Data.Text.Internal.Text -> OpenAPI.Common.SecurityScheme -apiKeyInHeaderAuthenticationSecurityScheme = Network.HTTP.Simple.addRequestHeader "api_key" GHC.Base.. OpenAPI.Common.textToByte +apiKeyInHeaderAuthenticationSecurityScheme = Network.HTTP.Simple.addRequestHeader "api_key" GHC.Internal.Base.. OpenAPI.Common.textToByte -- | Used to pass the authentication information for BasicAuthentication to 'basicAuthenticationSecurityScheme'. data BasicAuthenticationData = BasicAuthenticationData {basicAuthenticationDataUsername :: Data.Text.Internal.Text, basicAuthenticationDataPassword :: Data.Text.Internal.Text} - deriving (GHC.Show.Show, GHC.Classes.Ord, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Ord, GHC.Classes.Eq) -- | Use this security scheme to use basic authentication for a request. Should be used in a 'OpenAPI.Common.Configuration'. -- @@ -49,7 +49,7 @@ data BasicAuthenticationData -- @ basicAuthenticationSecurityScheme :: BasicAuthenticationData -> OpenAPI.Common.SecurityScheme -basicAuthenticationSecurityScheme = \basicAuth_0 -> Network.HTTP.Client.Request.applyBasicAuth (OpenAPI.Common.textToByte GHC.Base.$ basicAuthenticationDataUsername basicAuth_0) (OpenAPI.Common.textToByte GHC.Base.$ basicAuthenticationDataPassword basicAuth_0) +basicAuthenticationSecurityScheme = \basicAuth_0 -> Network.HTTP.Client.Request.applyBasicAuth (OpenAPI.Common.textToByte GHC.Internal.Base.$ basicAuthenticationDataUsername basicAuth_0) (OpenAPI.Common.textToByte GHC.Internal.Base.$ basicAuthenticationDataPassword basicAuth_0) -- | Use this security scheme to use bearer authentication for a request. Should be used in a 'OpenAPI.Common.Configuration'. -- @@ -62,4 +62,4 @@ basicAuthenticationSecurityScheme = \basicAuth_0 -> Network.HTTP.Client.Request. -- @ bearerAuthenticationSecurityScheme :: Data.Text.Internal.Text -> OpenAPI.Common.SecurityScheme -bearerAuthenticationSecurityScheme = \token_1 -> Network.HTTP.Simple.addRequestHeader "Authorization" GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ ("Bearer " GHC.Base.<> token_1)) +bearerAuthenticationSecurityScheme = \token_1 -> Network.HTTP.Simple.addRequestHeader "Authorization" GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ ("Bearer " GHC.Internal.Base.<> token_1)) diff --git a/example/generatedCode/src/OpenAPI/Types/ApiResponse.hs b/example/generatedCode/src/OpenAPI/Types/ApiResponse.hs index 8ae58e8..28506cb 100755 --- a/example/generatedCode/src/OpenAPI/Types/ApiResponse.hs +++ b/example/generatedCode/src/OpenAPI/Types/ApiResponse.hs @@ -46,20 +46,20 @@ import OpenAPI.TypeAlias -- data ApiResponse = ApiResponse { -- | code - apiResponseCode :: (GHC.Maybe.Maybe GHC.Int.Int32) + apiResponseCode :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int32) -- | message - , apiResponseMessage :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , apiResponseMessage :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | type - , apiResponseType :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , apiResponseType :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ApiResponse - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("code" Data.Aeson.Types.ToJSON..=)) (apiResponseCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("message" Data.Aeson.Types.ToJSON..=)) (apiResponseMessage obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (apiResponseType obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("code" Data.Aeson.Types.ToJSON..=)) (apiResponseCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("message" Data.Aeson.Types.ToJSON..=)) (apiResponseMessage obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (apiResponseType obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("code" Data.Aeson.Types.ToJSON..=)) (apiResponseCode obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("message" Data.Aeson.Types.ToJSON..=)) (apiResponseMessage obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (apiResponseType obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("code" Data.Aeson.Types.ToJSON..=)) (apiResponseCode obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("message" Data.Aeson.Types.ToJSON..=)) (apiResponseMessage obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (apiResponseType obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON ApiResponse - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "ApiResponse" (\obj -> ((GHC.Base.pure ApiResponse GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "message")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "type"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "ApiResponse" (\obj -> ((GHC.Internal.Base.pure ApiResponse GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "code")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "message")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "type"))} -- | Create a new 'ApiResponse' with all required fields. mkApiResponse :: ApiResponse -mkApiResponse = ApiResponse{apiResponseCode = GHC.Maybe.Nothing, - apiResponseMessage = GHC.Maybe.Nothing, - apiResponseType = GHC.Maybe.Nothing} +mkApiResponse = ApiResponse{apiResponseCode = GHC.Internal.Maybe.Nothing, + apiResponseMessage = GHC.Internal.Maybe.Nothing, + apiResponseType = GHC.Internal.Maybe.Nothing} diff --git a/example/generatedCode/src/OpenAPI/Types/Category.hs b/example/generatedCode/src/OpenAPI/Types/Category.hs index 163b142..a636664 100755 --- a/example/generatedCode/src/OpenAPI/Types/Category.hs +++ b/example/generatedCode/src/OpenAPI/Types/Category.hs @@ -46,17 +46,17 @@ import OpenAPI.TypeAlias -- data Category = Category { -- | id - categoryId :: (GHC.Maybe.Maybe GHC.Int.Int64) + categoryId :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | name - , categoryName :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , categoryName :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Category - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (categoryId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (categoryName obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (categoryId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (categoryName obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (categoryId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (categoryName obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (categoryId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (categoryName obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Category - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Category" (\obj -> (GHC.Base.pure Category GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Category" (\obj -> (GHC.Internal.Base.pure Category GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name"))} -- | Create a new 'Category' with all required fields. mkCategory :: Category -mkCategory = Category{categoryId = GHC.Maybe.Nothing, - categoryName = GHC.Maybe.Nothing} +mkCategory = Category{categoryId = GHC.Internal.Maybe.Nothing, + categoryName = GHC.Internal.Maybe.Nothing} diff --git a/example/generatedCode/src/OpenAPI/Types/Order.hs b/example/generatedCode/src/OpenAPI/Types/Order.hs index 0f9a764..09c99d8 100755 --- a/example/generatedCode/src/OpenAPI/Types/Order.hs +++ b/example/generatedCode/src/OpenAPI/Types/Order.hs @@ -46,32 +46,32 @@ import OpenAPI.TypeAlias -- data Order = Order { -- | complete - orderComplete :: (GHC.Maybe.Maybe GHC.Types.Bool) + orderComplete :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | id - , orderId :: (GHC.Maybe.Maybe GHC.Int.Int64) + , orderId :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | petId - , orderPetId :: (GHC.Maybe.Maybe GHC.Int.Int64) + , orderPetId :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | quantity - , orderQuantity :: (GHC.Maybe.Maybe GHC.Int.Int32) + , orderQuantity :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int32) -- | shipDate - , orderShipDate :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , orderShipDate :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | status: Order Status - , orderStatus :: (GHC.Maybe.Maybe OrderStatus) - } deriving (GHC.Show.Show + , orderStatus :: (GHC.Internal.Maybe.Maybe OrderStatus) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Order - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("complete" Data.Aeson.Types.ToJSON..=)) (orderComplete obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (orderId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("petId" Data.Aeson.Types.ToJSON..=)) (orderPetId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("quantity" Data.Aeson.Types.ToJSON..=)) (orderQuantity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("shipDate" Data.Aeson.Types.ToJSON..=)) (orderShipDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (orderStatus obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("complete" Data.Aeson.Types.ToJSON..=)) (orderComplete obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (orderId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("petId" Data.Aeson.Types.ToJSON..=)) (orderPetId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("quantity" Data.Aeson.Types.ToJSON..=)) (orderQuantity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("shipDate" Data.Aeson.Types.ToJSON..=)) (orderShipDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (orderStatus obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("complete" Data.Aeson.Types.ToJSON..=)) (orderComplete obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (orderId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("petId" Data.Aeson.Types.ToJSON..=)) (orderPetId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("quantity" Data.Aeson.Types.ToJSON..=)) (orderQuantity obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("shipDate" Data.Aeson.Types.ToJSON..=)) (orderShipDate obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (orderStatus obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("complete" Data.Aeson.Types.ToJSON..=)) (orderComplete obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (orderId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("petId" Data.Aeson.Types.ToJSON..=)) (orderPetId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("quantity" Data.Aeson.Types.ToJSON..=)) (orderQuantity obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("shipDate" Data.Aeson.Types.ToJSON..=)) (orderShipDate obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (orderStatus obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Order - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Order" (\obj -> (((((GHC.Base.pure Order GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "complete")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "petId")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "quantity")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "shipDate")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "status"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Order" (\obj -> (((((GHC.Internal.Base.pure Order GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "complete")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "petId")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "quantity")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "shipDate")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "status"))} -- | Create a new 'Order' with all required fields. mkOrder :: Order -mkOrder = Order{orderComplete = GHC.Maybe.Nothing, - orderId = GHC.Maybe.Nothing, - orderPetId = GHC.Maybe.Nothing, - orderQuantity = GHC.Maybe.Nothing, - orderShipDate = GHC.Maybe.Nothing, - orderStatus = GHC.Maybe.Nothing} +mkOrder = Order{orderComplete = GHC.Internal.Maybe.Nothing, + orderId = GHC.Internal.Maybe.Nothing, + orderPetId = GHC.Internal.Maybe.Nothing, + orderQuantity = GHC.Internal.Maybe.Nothing, + orderShipDate = GHC.Internal.Maybe.Nothing, + orderStatus = GHC.Internal.Maybe.Nothing} -- | Defines the enum schema located at @components.schemas.Order.properties.status@ in the specification. -- -- Order Status @@ -81,7 +81,7 @@ data OrderStatus = | OrderStatusEnumPlaced -- ^ Represents the JSON value @"placed"@ | OrderStatusEnumApproved -- ^ Represents the JSON value @"approved"@ | OrderStatusEnumDelivered -- ^ Represents the JSON value @"delivered"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON OrderStatus where {toJSON (OrderStatusOther val) = val; toJSON (OrderStatusTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -89,7 +89,7 @@ instance Data.Aeson.Types.ToJSON.ToJSON OrderStatus toJSON (OrderStatusEnumApproved) = "approved"; toJSON (OrderStatusEnumDelivered) = "delivered"} instance Data.Aeson.Types.FromJSON.FromJSON OrderStatus - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "placed" -> OrderStatusEnumPlaced - | val GHC.Classes.== "approved" -> OrderStatusEnumApproved - | val GHC.Classes.== "delivered" -> OrderStatusEnumDelivered - | GHC.Base.otherwise -> OrderStatusOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "placed" -> OrderStatusEnumPlaced + | val GHC.Classes.== "approved" -> OrderStatusEnumApproved + | val GHC.Classes.== "delivered" -> OrderStatusEnumDelivered + | GHC.Internal.Base.otherwise -> OrderStatusOther val)} diff --git a/example/generatedCode/src/OpenAPI/Types/Pet.hs b/example/generatedCode/src/OpenAPI/Types/Pet.hs index c2c06e2..122e293 100755 --- a/example/generatedCode/src/OpenAPI/Types/Pet.hs +++ b/example/generatedCode/src/OpenAPI/Types/Pet.hs @@ -48,34 +48,34 @@ import {-# SOURCE #-} OpenAPI.Types.Tag -- data Pet = Pet { -- | category - petCategory :: (GHC.Maybe.Maybe Category) + petCategory :: (GHC.Internal.Maybe.Maybe Category) -- | id - , petId :: (GHC.Maybe.Maybe GHC.Int.Int64) + , petId :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | name , petName :: Data.Text.Internal.Text -- | photoUrls , petPhotoUrls :: [Data.Text.Internal.Text] -- | status: pet status in the store - , petStatus :: (GHC.Maybe.Maybe PetStatus) + , petStatus :: (GHC.Internal.Maybe.Maybe PetStatus) -- | tags - , petTags :: (GHC.Maybe.Maybe [Tag]) - } deriving (GHC.Show.Show + , petTags :: (GHC.Internal.Maybe.Maybe [Tag]) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Pet - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("category" Data.Aeson.Types.ToJSON..=)) (petCategory obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (petId obj) : ["name" Data.Aeson.Types.ToJSON..= petName obj] : ["photoUrls" Data.Aeson.Types.ToJSON..= petPhotoUrls obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (petStatus obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (petTags obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("category" Data.Aeson.Types.ToJSON..=)) (petCategory obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (petId obj) : ["name" Data.Aeson.Types.ToJSON..= petName obj] : ["photoUrls" Data.Aeson.Types.ToJSON..= petPhotoUrls obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (petStatus obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (petTags obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("category" Data.Aeson.Types.ToJSON..=)) (petCategory obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (petId obj) : ["name" Data.Aeson.Types.ToJSON..= petName obj] : ["photoUrls" Data.Aeson.Types.ToJSON..= petPhotoUrls obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (petStatus obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (petTags obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("category" Data.Aeson.Types.ToJSON..=)) (petCategory obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (petId obj) : ["name" Data.Aeson.Types.ToJSON..= petName obj] : ["photoUrls" Data.Aeson.Types.ToJSON..= petPhotoUrls obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("status" Data.Aeson.Types.ToJSON..=)) (petStatus obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (petTags obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Pet - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Pet" (\obj -> (((((GHC.Base.pure Pet GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "category")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "photoUrls")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "status")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tags"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Pet" (\obj -> (((((GHC.Internal.Base.pure Pet GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "category")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "name")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "photoUrls")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "status")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tags"))} -- | Create a new 'Pet' with all required fields. mkPet :: Data.Text.Internal.Text -- ^ 'petName' -> [Data.Text.Internal.Text] -- ^ 'petPhotoUrls' -> Pet -mkPet petName petPhotoUrls = Pet{petCategory = GHC.Maybe.Nothing, - petId = GHC.Maybe.Nothing, +mkPet petName petPhotoUrls = Pet{petCategory = GHC.Internal.Maybe.Nothing, + petId = GHC.Internal.Maybe.Nothing, petName = petName, petPhotoUrls = petPhotoUrls, - petStatus = GHC.Maybe.Nothing, - petTags = GHC.Maybe.Nothing} + petStatus = GHC.Internal.Maybe.Nothing, + petTags = GHC.Internal.Maybe.Nothing} -- | Defines the enum schema located at @components.schemas.Pet.properties.status@ in the specification. -- -- pet status in the store @@ -85,7 +85,7 @@ data PetStatus = | PetStatusEnumAvailable -- ^ Represents the JSON value @"available"@ | PetStatusEnumPending -- ^ Represents the JSON value @"pending"@ | PetStatusEnumSold -- ^ Represents the JSON value @"sold"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetStatus where {toJSON (PetStatusOther val) = val; toJSON (PetStatusTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -93,7 +93,7 @@ instance Data.Aeson.Types.ToJSON.ToJSON PetStatus toJSON (PetStatusEnumPending) = "pending"; toJSON (PetStatusEnumSold) = "sold"} instance Data.Aeson.Types.FromJSON.FromJSON PetStatus - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "available" -> PetStatusEnumAvailable - | val GHC.Classes.== "pending" -> PetStatusEnumPending - | val GHC.Classes.== "sold" -> PetStatusEnumSold - | GHC.Base.otherwise -> PetStatusOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "available" -> PetStatusEnumAvailable + | val GHC.Classes.== "pending" -> PetStatusEnumPending + | val GHC.Classes.== "sold" -> PetStatusEnumSold + | GHC.Internal.Base.otherwise -> PetStatusOther val)} diff --git a/example/generatedCode/src/OpenAPI/Types/Tag.hs b/example/generatedCode/src/OpenAPI/Types/Tag.hs index 8ef72f5..08b1f29 100755 --- a/example/generatedCode/src/OpenAPI/Types/Tag.hs +++ b/example/generatedCode/src/OpenAPI/Types/Tag.hs @@ -46,16 +46,17 @@ import OpenAPI.TypeAlias -- data Tag = Tag { -- | id - tagId :: (GHC.Maybe.Maybe GHC.Int.Int64) + tagId :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | name - , tagName :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , tagName :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Tag - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (tagId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (tagName obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (tagId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (tagName obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (tagId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (tagName obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (tagId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (tagName obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Tag - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Tag" (\obj -> (GHC.Base.pure Tag GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Tag" (\obj -> (GHC.Internal.Base.pure Tag GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name"))} -- | Create a new 'Tag' with all required fields. mkTag :: Tag -mkTag = Tag{tagId = GHC.Maybe.Nothing, tagName = GHC.Maybe.Nothing} +mkTag = Tag{tagId = GHC.Internal.Maybe.Nothing, + tagName = GHC.Internal.Maybe.Nothing} diff --git a/example/generatedCode/src/OpenAPI/Types/User.hs b/example/generatedCode/src/OpenAPI/Types/User.hs index f20691e..9acdf67 100755 --- a/example/generatedCode/src/OpenAPI/Types/User.hs +++ b/example/generatedCode/src/OpenAPI/Types/User.hs @@ -46,35 +46,35 @@ import OpenAPI.TypeAlias -- data User = User { -- | email - userEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + userEmail :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | firstName - , userFirstName :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , userFirstName :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | id - , userId :: (GHC.Maybe.Maybe GHC.Int.Int64) + , userId :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | lastName - , userLastName :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , userLastName :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | password - , userPassword :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , userPassword :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | phone - , userPhone :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , userPhone :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | userStatus: User Status - , userUserStatus :: (GHC.Maybe.Maybe GHC.Int.Int32) + , userUserStatus :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int32) -- | username - , userUsername :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , userUsername :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON User - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (userEmail obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("firstName" Data.Aeson.Types.ToJSON..=)) (userFirstName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (userId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("lastName" Data.Aeson.Types.ToJSON..=)) (userLastName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("password" Data.Aeson.Types.ToJSON..=)) (userPassword obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (userPhone obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("userStatus" Data.Aeson.Types.ToJSON..=)) (userUserStatus obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("username" Data.Aeson.Types.ToJSON..=)) (userUsername obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (userEmail obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("firstName" Data.Aeson.Types.ToJSON..=)) (userFirstName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (userId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("lastName" Data.Aeson.Types.ToJSON..=)) (userLastName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("password" Data.Aeson.Types.ToJSON..=)) (userPassword obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (userPhone obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("userStatus" Data.Aeson.Types.ToJSON..=)) (userUserStatus obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("username" Data.Aeson.Types.ToJSON..=)) (userUsername obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (userEmail obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("firstName" Data.Aeson.Types.ToJSON..=)) (userFirstName obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (userId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("lastName" Data.Aeson.Types.ToJSON..=)) (userLastName obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("password" Data.Aeson.Types.ToJSON..=)) (userPassword obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (userPhone obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("userStatus" Data.Aeson.Types.ToJSON..=)) (userUserStatus obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("username" Data.Aeson.Types.ToJSON..=)) (userUsername obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (userEmail obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("firstName" Data.Aeson.Types.ToJSON..=)) (userFirstName obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (userId obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("lastName" Data.Aeson.Types.ToJSON..=)) (userLastName obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("password" Data.Aeson.Types.ToJSON..=)) (userPassword obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (userPhone obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("userStatus" Data.Aeson.Types.ToJSON..=)) (userUserStatus obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("username" Data.Aeson.Types.ToJSON..=)) (userUsername obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON User - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "User" (\obj -> (((((((GHC.Base.pure User GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "email")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "firstName")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "lastName")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "password")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "phone")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "userStatus")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "username"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "User" (\obj -> (((((((GHC.Internal.Base.pure User GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "email")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "firstName")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "lastName")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "password")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "phone")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "userStatus")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "username"))} -- | Create a new 'User' with all required fields. mkUser :: User -mkUser = User{userEmail = GHC.Maybe.Nothing, - userFirstName = GHC.Maybe.Nothing, - userId = GHC.Maybe.Nothing, - userLastName = GHC.Maybe.Nothing, - userPassword = GHC.Maybe.Nothing, - userPhone = GHC.Maybe.Nothing, - userUserStatus = GHC.Maybe.Nothing, - userUsername = GHC.Maybe.Nothing} +mkUser = User{userEmail = GHC.Internal.Maybe.Nothing, + userFirstName = GHC.Internal.Maybe.Nothing, + userId = GHC.Internal.Maybe.Nothing, + userLastName = GHC.Internal.Maybe.Nothing, + userPassword = GHC.Internal.Maybe.Nothing, + userPhone = GHC.Internal.Maybe.Nothing, + userUserStatus = GHC.Internal.Maybe.Nothing, + userUsername = GHC.Internal.Maybe.Nothing} diff --git a/flake.lock b/flake.lock index af3bb90..8749369 100644 --- a/flake.lock +++ b/flake.lock @@ -57,16 +57,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1748162331, - "narHash": "sha256-rqc2RKYTxP3tbjA+PB3VMRQNnjesrT0pEofXQTrMsS8=", + "lastModified": 1764522689, + "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334", + "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-25.05", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index a2523fd..1206531 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "openapi-code-generator"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-25.11"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; flake-utils.url = "github:numtide/flake-utils"; }; diff --git a/stack.yaml b/stack.yaml index 6ecc72c..eaadaca 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-23.19 +resolver: lts-24.16 packages: - openapi3-code-generator diff --git a/stack.yaml.lock b/stack.yaml.lock index fc7aea1..0895e0f 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - sha256: 296a7960c37efa382432ab497161a092684191815eb92a608c5d6ea5f894ace3 - size: 683835 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/19.yaml - original: lts-23.19 + sha256: 309392e77af949aff34933aff53070c774d274b0f2f7e314df665c0d322c7715 + size: 726103 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/16.yaml + original: lts-24.16 diff --git a/testing/golden-output/src/OpenAPI/Operations/MultiParam.hs b/testing/golden-output/src/OpenAPI/Operations/MultiParam.hs index 92fe627..e257a25 100755 --- a/testing/golden-output/src/OpenAPI/Operations/MultiParam.hs +++ b/testing/golden-output/src/OpenAPI/Operations/MultiParam.hs @@ -60,11 +60,11 @@ import OpenAPI.Types -- Operation with multiple parameters multiParam :: forall m . OpenAPI.Common.MonadHTTP m => MultiParamParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response MultiParamResponse) -- ^ Monadic computation which returns the result of the operation -multiParam parameters = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either MultiParamResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) +multiParam parameters = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either MultiParamResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Internal.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | Defines the object schema located at @paths.\/pet\/multiparam\/{status}.GET.parameters@ in the specification. -- -- @@ -76,27 +76,27 @@ data MultiParamParameters = MultiParamParameters { -- | queryFilter: Represents the parameter named \'filter\' -- -- Filter the entries? - , multiParamParametersQueryFilter :: (GHC.Maybe.Maybe GHC.Types.Bool) + , multiParamParametersQueryFilter :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | queryReferenceParameter , multiParamParametersQueryReferenceParameter :: Cat -- | queryStatus: Represents the parameter named \'status\' -- -- Status in query , multiParamParametersQueryStatus :: MultiParamParametersQueryStatus - } deriving (GHC.Show.Show + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MultiParamParameters - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["pathStatus" Data.Aeson.Types.ToJSON..= multiParamParametersPathStatus obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("queryFilter" Data.Aeson.Types.ToJSON..=)) (multiParamParametersQueryFilter obj) : ["queryReferenceParameter" Data.Aeson.Types.ToJSON..= multiParamParametersQueryReferenceParameter obj] : ["queryStatus" Data.Aeson.Types.ToJSON..= multiParamParametersQueryStatus obj] : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["pathStatus" Data.Aeson.Types.ToJSON..= multiParamParametersPathStatus obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("queryFilter" Data.Aeson.Types.ToJSON..=)) (multiParamParametersQueryFilter obj) : ["queryReferenceParameter" Data.Aeson.Types.ToJSON..= multiParamParametersQueryReferenceParameter obj] : ["queryStatus" Data.Aeson.Types.ToJSON..= multiParamParametersQueryStatus obj] : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["pathStatus" Data.Aeson.Types.ToJSON..= multiParamParametersPathStatus obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("queryFilter" Data.Aeson.Types.ToJSON..=)) (multiParamParametersQueryFilter obj) : ["queryReferenceParameter" Data.Aeson.Types.ToJSON..= multiParamParametersQueryReferenceParameter obj] : ["queryStatus" Data.Aeson.Types.ToJSON..= multiParamParametersQueryStatus obj] : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["pathStatus" Data.Aeson.Types.ToJSON..= multiParamParametersPathStatus obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("queryFilter" Data.Aeson.Types.ToJSON..=)) (multiParamParametersQueryFilter obj) : ["queryReferenceParameter" Data.Aeson.Types.ToJSON..= multiParamParametersQueryReferenceParameter obj] : ["queryStatus" Data.Aeson.Types.ToJSON..= multiParamParametersQueryStatus obj] : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON MultiParamParameters - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MultiParamParameters" (\obj -> (((GHC.Base.pure MultiParamParameters GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pathStatus")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "queryFilter")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryReferenceParameter")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryStatus"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MultiParamParameters" (\obj -> (((GHC.Internal.Base.pure MultiParamParameters GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pathStatus")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "queryFilter")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryReferenceParameter")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryStatus"))} -- | Create a new 'MultiParamParameters' with all required fields. mkMultiParamParameters :: MultiParamParametersPathStatus -- ^ 'multiParamParametersPathStatus' -> Cat -- ^ 'multiParamParametersQueryReferenceParameter' -> MultiParamParametersQueryStatus -- ^ 'multiParamParametersQueryStatus' -> MultiParamParameters mkMultiParamParameters multiParamParametersPathStatus multiParamParametersQueryReferenceParameter multiParamParametersQueryStatus = MultiParamParameters{multiParamParametersPathStatus = multiParamParametersPathStatus, - multiParamParametersQueryFilter = GHC.Maybe.Nothing, + multiParamParametersQueryFilter = GHC.Internal.Maybe.Nothing, multiParamParametersQueryReferenceParameter = multiParamParametersQueryReferenceParameter, multiParamParametersQueryStatus = multiParamParametersQueryStatus} -- | Defines the enum schema located at @paths.\/pet\/multiparam\/{status}.GET.parameters.properties.pathStatus@ in the specification. @@ -110,7 +110,7 @@ data MultiParamParametersPathStatus = | MultiParamParametersPathStatusEnum1 -- ^ Represents the JSON value @1@ | MultiParamParametersPathStatusEnum3 -- ^ Represents the JSON value @3@ | MultiParamParametersPathStatusEnum5 -- ^ Represents the JSON value @5@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MultiParamParametersPathStatus where {toJSON (MultiParamParametersPathStatusOther val) = val; toJSON (MultiParamParametersPathStatusTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -118,10 +118,10 @@ instance Data.Aeson.Types.ToJSON.ToJSON MultiParamParametersPathStatus toJSON (MultiParamParametersPathStatusEnum3) = Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 3 0); toJSON (MultiParamParametersPathStatusEnum5) = Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 5 0)} instance Data.Aeson.Types.FromJSON.FromJSON MultiParamParametersPathStatus - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 1 0) -> MultiParamParametersPathStatusEnum1 - | val GHC.Classes.== Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 3 0) -> MultiParamParametersPathStatusEnum3 - | val GHC.Classes.== Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 5 0) -> MultiParamParametersPathStatusEnum5 - | GHC.Base.otherwise -> MultiParamParametersPathStatusOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 1 0) -> MultiParamParametersPathStatusEnum1 + | val GHC.Classes.== Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 3 0) -> MultiParamParametersPathStatusEnum3 + | val GHC.Classes.== Data.Aeson.Types.Internal.Number (Data.Scientific.scientific 5 0) -> MultiParamParametersPathStatusEnum5 + | GHC.Internal.Base.otherwise -> MultiParamParametersPathStatusOther val)} -- | Defines the enum schema located at @paths.\/pet\/multiparam\/{status}.GET.parameters.properties.queryStatus@ in the specification. -- -- Represents the parameter named \'status\' @@ -133,7 +133,7 @@ data MultiParamParametersQueryStatus = | MultiParamParametersQueryStatusEnumAvailable -- ^ Represents the JSON value @"available"@ | MultiParamParametersQueryStatusEnumPending -- ^ Represents the JSON value @"pending"@ | MultiParamParametersQueryStatusEnumSold -- ^ Represents the JSON value @"sold"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MultiParamParametersQueryStatus where {toJSON (MultiParamParametersQueryStatusOther val) = val; toJSON (MultiParamParametersQueryStatusTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -141,17 +141,17 @@ instance Data.Aeson.Types.ToJSON.ToJSON MultiParamParametersQueryStatus toJSON (MultiParamParametersQueryStatusEnumPending) = "pending"; toJSON (MultiParamParametersQueryStatusEnumSold) = "sold"} instance Data.Aeson.Types.FromJSON.FromJSON MultiParamParametersQueryStatus - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "available" -> MultiParamParametersQueryStatusEnumAvailable - | val GHC.Classes.== "pending" -> MultiParamParametersQueryStatusEnumPending - | val GHC.Classes.== "sold" -> MultiParamParametersQueryStatusEnumSold - | GHC.Base.otherwise -> MultiParamParametersQueryStatusOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "available" -> MultiParamParametersQueryStatusEnumAvailable + | val GHC.Classes.== "pending" -> MultiParamParametersQueryStatusEnumPending + | val GHC.Classes.== "sold" -> MultiParamParametersQueryStatusEnumSold + | GHC.Internal.Base.otherwise -> MultiParamParametersQueryStatusOther val)} -- | Represents a response of the operation 'multiParam'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'MultiParamResponseError' is used. data MultiParamResponse = - MultiParamResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + MultiParamResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | MultiParamResponse200 Dog -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/multiparam/{status} -- -- The same as 'multiParam' but accepts an explicit configuration. @@ -159,19 +159,19 @@ multiParamWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI. -> MultiParamParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> m (Network.HTTP.Client.Types.Response MultiParamResponse) -- ^ Monadic computation which returns the result of the operation multiParamWithConfiguration config - parameters = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either MultiParamResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) + parameters = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either MultiParamResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Internal.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/multiparam/{status} -- -- The same as 'multiParam' but returns the raw 'Data.ByteString.ByteString'. multiParamRaw :: forall m . OpenAPI.Common.MonadHTTP m => MultiParamParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -multiParamRaw parameters = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) +multiParamRaw parameters = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Internal.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/multiparam/{status} -- -- The same as 'multiParam' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -179,6 +179,6 @@ multiParamWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenA -> MultiParamParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation multiParamWithConfigurationRaw config - parameters = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) + parameters = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pet/multiparam/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel (multiParamParametersPathStatus parameters))) GHC.Internal.Base.<> "")) [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryStatus parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "filter") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamParametersQueryFilter parameters) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "referenceParameter") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamParametersQueryReferenceParameter parameters)) (Data.Text.Internal.pack "form") GHC.Types.False]) diff --git a/testing/golden-output/src/OpenAPI/Operations/MultiParamWithFixedEnum.hs b/testing/golden-output/src/OpenAPI/Operations/MultiParamWithFixedEnum.hs index c0e788e..8423391 100755 --- a/testing/golden-output/src/OpenAPI/Operations/MultiParamWithFixedEnum.hs +++ b/testing/golden-output/src/OpenAPI/Operations/MultiParamWithFixedEnum.hs @@ -60,10 +60,10 @@ import OpenAPI.Types -- Operation with multiple parameters multiParamWithFixedEnum :: forall m . OpenAPI.Common.MonadHTTP m => MultiParamWithFixedEnumParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response MultiParamWithFixedEnumResponse) -- ^ Monadic computation which returns the result of the operation -multiParamWithFixedEnum parameters = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either MultiParamWithFixedEnumResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamWithFixedEnumResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) +multiParamWithFixedEnum parameters = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either MultiParamWithFixedEnumResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamWithFixedEnumResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | Defines the object schema located at @paths.\/pet\/multiparamwithfixedenum.GET.parameters@ in the specification. -- -- @@ -75,19 +75,19 @@ data MultiParamWithFixedEnumParameters = MultiParamWithFixedEnumParameters { -- | queryOther: Represents the parameter named \'other\' -- -- Some other value - , multiParamWithFixedEnumParametersQueryOther :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , multiParamWithFixedEnumParametersQueryOther :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MultiParamWithFixedEnumParameters - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["queryFixedenumvalue" Data.Aeson.Types.ToJSON..= multiParamWithFixedEnumParametersQueryFixedenumvalue obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("queryOther" Data.Aeson.Types.ToJSON..=)) (multiParamWithFixedEnumParametersQueryOther obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["queryFixedenumvalue" Data.Aeson.Types.ToJSON..= multiParamWithFixedEnumParametersQueryFixedenumvalue obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("queryOther" Data.Aeson.Types.ToJSON..=)) (multiParamWithFixedEnumParametersQueryOther obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["queryFixedenumvalue" Data.Aeson.Types.ToJSON..= multiParamWithFixedEnumParametersQueryFixedenumvalue obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("queryOther" Data.Aeson.Types.ToJSON..=)) (multiParamWithFixedEnumParametersQueryOther obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["queryFixedenumvalue" Data.Aeson.Types.ToJSON..= multiParamWithFixedEnumParametersQueryFixedenumvalue obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("queryOther" Data.Aeson.Types.ToJSON..=)) (multiParamWithFixedEnumParametersQueryOther obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON MultiParamWithFixedEnumParameters - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MultiParamWithFixedEnumParameters" (\obj -> (GHC.Base.pure MultiParamWithFixedEnumParameters GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryFixedenumvalue")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "queryOther"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MultiParamWithFixedEnumParameters" (\obj -> (GHC.Internal.Base.pure MultiParamWithFixedEnumParameters GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "queryFixedenumvalue")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "queryOther"))} -- | Create a new 'MultiParamWithFixedEnumParameters' with all required fields. mkMultiParamWithFixedEnumParameters :: MultiParamWithFixedEnumParametersQueryFixedenumvalue -- ^ 'multiParamWithFixedEnumParametersQueryFixedenumvalue' -> MultiParamWithFixedEnumParameters mkMultiParamWithFixedEnumParameters multiParamWithFixedEnumParametersQueryFixedenumvalue = MultiParamWithFixedEnumParameters{multiParamWithFixedEnumParametersQueryFixedenumvalue = multiParamWithFixedEnumParametersQueryFixedenumvalue, - multiParamWithFixedEnumParametersQueryOther = GHC.Maybe.Nothing} + multiParamWithFixedEnumParametersQueryOther = GHC.Internal.Maybe.Nothing} -- | Defines the enum schema located at @paths.\/pet\/multiparamwithfixedenum.GET.parameters.properties.queryFixedenumvalue@ in the specification. -- -- Represents the parameter named \'fixedenumvalue\' @@ -97,21 +97,21 @@ data MultiParamWithFixedEnumParametersQueryFixedenumvalue = MultiParamWithFixedEnumParametersQueryFixedenumvalueOther Data.Aeson.Types.Internal.Value -- ^ This case is used if the value encountered during decoding does not match any of the provided cases in the specification. | MultiParamWithFixedEnumParametersQueryFixedenumvalueTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | MultiParamWithFixedEnumParametersQueryFixedenumvalueEnumThefixedvalue -- ^ Represents the JSON value @"thefixedvalue"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MultiParamWithFixedEnumParametersQueryFixedenumvalue where {toJSON (MultiParamWithFixedEnumParametersQueryFixedenumvalueOther val) = val; toJSON (MultiParamWithFixedEnumParametersQueryFixedenumvalueTyped val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (MultiParamWithFixedEnumParametersQueryFixedenumvalueEnumThefixedvalue) = "thefixedvalue"} instance Data.Aeson.Types.FromJSON.FromJSON MultiParamWithFixedEnumParametersQueryFixedenumvalue - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "thefixedvalue" -> MultiParamWithFixedEnumParametersQueryFixedenumvalueEnumThefixedvalue - | GHC.Base.otherwise -> MultiParamWithFixedEnumParametersQueryFixedenumvalueOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "thefixedvalue" -> MultiParamWithFixedEnumParametersQueryFixedenumvalueEnumThefixedvalue + | GHC.Internal.Base.otherwise -> MultiParamWithFixedEnumParametersQueryFixedenumvalueOther val)} -- | Represents a response of the operation 'multiParamWithFixedEnum'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'MultiParamWithFixedEnumResponseError' is used. data MultiParamWithFixedEnumResponse = - MultiParamWithFixedEnumResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + MultiParamWithFixedEnumResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | MultiParamWithFixedEnumResponse200 Dog -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/multiparamwithfixedenum -- -- The same as 'multiParamWithFixedEnum' but accepts an explicit configuration. @@ -119,17 +119,17 @@ multiParamWithFixedEnumWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP -> MultiParamWithFixedEnumParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> m (Network.HTTP.Client.Types.Response MultiParamWithFixedEnumResponse) -- ^ Monadic computation which returns the result of the operation multiParamWithFixedEnumWithConfiguration config - parameters = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either MultiParamWithFixedEnumResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamWithFixedEnumResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) + parameters = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either MultiParamWithFixedEnumResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> MultiParamWithFixedEnumResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/multiparamwithfixedenum -- -- The same as 'multiParamWithFixedEnum' but returns the raw 'Data.ByteString.ByteString'. multiParamWithFixedEnumRaw :: forall m . OpenAPI.Common.MonadHTTP m => MultiParamWithFixedEnumParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -multiParamWithFixedEnumRaw parameters = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) +multiParamWithFixedEnumRaw parameters = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/multiparamwithfixedenum -- -- The same as 'multiParamWithFixedEnum' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -137,5 +137,5 @@ multiParamWithFixedEnumWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHT -> MultiParamWithFixedEnumParameters -- ^ Contains all available parameters of this operation (query and path parameters) -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation multiParamWithFixedEnumWithConfigurationRaw config - parameters = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, - OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) + parameters = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/multiparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON (multiParamWithFixedEnumParametersQueryFixedenumvalue parameters)) (Data.Text.Internal.pack "form") GHC.Types.False, + OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "other") (Data.Aeson.Types.ToJSON.toJSON GHC.Internal.Data.Functor.<$> multiParamWithFixedEnumParametersQueryOther parameters) (Data.Text.Internal.pack "form") GHC.Types.False]) diff --git a/testing/golden-output/src/OpenAPI/Operations/NoParam.hs b/testing/golden-output/src/OpenAPI/Operations/NoParam.hs index 3c2059a..448dc3f 100755 --- a/testing/golden-output/src/OpenAPI/Operations/NoParam.hs +++ b/testing/golden-output/src/OpenAPI/Operations/NoParam.hs @@ -59,32 +59,32 @@ import OpenAPI.Types -- -- Operation with no parameters noParam :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response NoParamResponse) -- ^ Monadic computation which returns the result of the operation -noParam = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either NoParamResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> NoParamResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Base.mempty) +noParam = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either NoParamResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> NoParamResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Internal.Base.mempty) -- | Represents a response of the operation 'noParam'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'NoParamResponseError' is used. data NoParamResponse = - NoParamResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + NoParamResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | NoParamResponse200 Dog -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/noparam -- -- The same as 'noParam' but accepts an explicit configuration. noParamWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request -> m (Network.HTTP.Client.Types.Response NoParamResponse) -- ^ Monadic computation which returns the result of the operation -noParamWithConfiguration config = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either NoParamResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> NoParamResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Base.mempty) +noParamWithConfiguration config = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either NoParamResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> NoParamResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Internal.Base.mempty) -- | > GET /pet/noparam -- -- The same as 'noParam' but returns the raw 'Data.ByteString.ByteString'. noParamRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -noParamRaw = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Base.mempty) +noParamRaw = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Internal.Base.mempty) -- | > GET /pet/noparam -- -- The same as 'noParam' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. noParamWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -noParamWithConfigurationRaw config = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Base.mempty) +noParamWithConfigurationRaw config = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/noparam" GHC.Internal.Base.mempty) diff --git a/testing/golden-output/src/OpenAPI/Operations/Patch_pets.hs b/testing/golden-output/src/OpenAPI/Operations/Patch_pets.hs index c25750b..924e24b 100755 --- a/testing/golden-output/src/OpenAPI/Operations/Patch_pets.hs +++ b/testing/golden-output/src/OpenAPI/Operations/Patch_pets.hs @@ -58,10 +58,10 @@ import OpenAPI.Types -- | > PATCH /pets -- -- -patch_pets :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ The request body to send +patch_pets :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ The request body to send -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Patch_petsResponse) -- ^ Monadic computation which returns the result of the operation -patch_pets body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either Patch_petsResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right Patch_petsResponse200 - | 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 "PATCH") "/pets" GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) +patch_pets body = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either Patch_petsResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right Patch_petsResponse200 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PATCH") "/pets" GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) -- | Defines the oneOf schema located at @paths.\/pets.PATCH.requestBody.content.application\/json.schema.oneOf@ in the specification. -- -- @@ -69,42 +69,42 @@ data Patch_petsRequestBodyVariants = Patch_petsRequestBodyCat Cat | Patch_petsRequestBodyDog Dog | Patch_petsRequestBodyCoverType CoverType - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Patch_petsRequestBodyVariants where {toJSON (Patch_petsRequestBodyCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (Patch_petsRequestBodyDog a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (Patch_petsRequestBodyCoverType a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON Patch_petsRequestBodyVariants - where {parseJSON val = case (Patch_petsRequestBodyCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((Patch_petsRequestBodyDog Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((Patch_petsRequestBodyCoverType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (Patch_petsRequestBodyCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((Patch_petsRequestBodyDog GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((Patch_petsRequestBodyCoverType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Represents a response of the operation 'patch_pets'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'Patch_petsResponseError' is used. data Patch_petsResponse = - Patch_petsResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + Patch_petsResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | Patch_petsResponse200 -- ^ Updated - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > PATCH /pets -- -- The same as 'patch_pets' but accepts an explicit configuration. patch_petsWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ The request body to send + -> GHC.Internal.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ The request body to send -> m (Network.HTTP.Client.Types.Response Patch_petsResponse) -- ^ Monadic computation which returns the result of the operation patch_petsWithConfiguration config - body = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either Patch_petsResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right Patch_petsResponse200 - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PATCH") "/pets" GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either Patch_petsResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> GHC.Internal.Data.Either.Right Patch_petsResponse200 + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PATCH") "/pets" GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) -- | > PATCH /pets -- -- The same as 'patch_pets' but returns the raw 'Data.ByteString.ByteString'. -patch_petsRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ The request body to send +patch_petsRaw :: forall m . OpenAPI.Common.MonadHTTP m => GHC.Internal.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ 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 -patch_petsRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PATCH") "/pets" GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) +patch_petsRaw body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PATCH") "/pets" GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) -- | > PATCH /pets -- -- The same as 'patch_pets' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. patch_petsWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request - -> GHC.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ The request body to send + -> GHC.Internal.Maybe.Maybe Patch_petsRequestBodyVariants -- ^ 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 patch_petsWithConfigurationRaw config - body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "PATCH") "/pets" GHC.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) + body = GHC.Internal.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "PATCH") "/pets" GHC.Internal.Base.mempty body OpenAPI.Common.RequestBodyEncodingJSON) diff --git a/testing/golden-output/src/OpenAPI/Operations/ShowPetById.hs b/testing/golden-output/src/OpenAPI/Operations/ShowPetById.hs index f4a4c3d..8c40ee8 100755 --- a/testing/golden-output/src/OpenAPI/Operations/ShowPetById.hs +++ b/testing/golden-output/src/OpenAPI/Operations/ShowPetById.hs @@ -60,16 +60,16 @@ import OpenAPI.Types -- Info for a specific pet showPetById :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Text -- ^ petId: The id of the pet to retrieve -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response ShowPetByIdResponse) -- ^ Monadic computation which returns the result of the operation -showPetById petId = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either ShowPetByIdResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> ShowPetByIdResponseDefault Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) +showPetById petId = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either ShowPetByIdResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> ShowPetByIdResponseDefault GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | Represents a response of the operation 'showPetById'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'ShowPetByIdResponseError' is used. data ShowPetByIdResponse = - ShowPetByIdResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + ShowPetByIdResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | ShowPetByIdResponseDefault Dog -- ^ Expected response to a valid request - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pets/{petId} -- -- The same as 'showPetById' but accepts an explicit configuration. @@ -77,15 +77,15 @@ showPetByIdWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI -> Data.Text.Internal.Text -- ^ petId: The id of the pet to retrieve -> m (Network.HTTP.Client.Types.Response ShowPetByIdResponse) -- ^ Monadic computation which returns the result of the operation showPetByIdWithConfiguration config - petId = GHC.Base.fmap (\response_1 -> GHC.Base.fmap (Data.Either.either ShowPetByIdResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> ShowPetByIdResponseDefault Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) + petId = GHC.Internal.Base.fmap (\response_1 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either ShowPetByIdResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | GHC.Internal.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> ShowPetByIdResponseDefault GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /pets/{petId} -- -- The same as 'showPetById' but returns the raw 'Data.ByteString.ByteString'. showPetByIdRaw :: forall m . OpenAPI.Common.MonadHTTP m => Data.Text.Internal.Text -- ^ petId: The id of the pet to retrieve -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -showPetByIdRaw petId = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) +showPetByIdRaw petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) -- | > GET /pets/{petId} -- -- The same as 'showPetById' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -93,4 +93,4 @@ showPetByIdWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => Open -> Data.Text.Internal.Text -- ^ petId: The id of the pet to retrieve -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation showPetByIdWithConfigurationRaw config - petId = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Base.<> "")) GHC.Base.mempty) + petId = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") ("/pets/" GHC.Internal.Base.<> (OpenAPI.Common.byteToText (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ OpenAPI.Common.stringifyModel petId)) GHC.Internal.Base.<> "")) GHC.Internal.Base.mempty) diff --git a/testing/golden-output/src/OpenAPI/Operations/SingleParam.hs b/testing/golden-output/src/OpenAPI/Operations/SingleParam.hs index 031d510..df9b817 100755 --- a/testing/golden-output/src/OpenAPI/Operations/SingleParam.hs +++ b/testing/golden-output/src/OpenAPI/Operations/SingleParam.hs @@ -60,9 +60,9 @@ import OpenAPI.Types -- Operation with a single parameter singleParam :: forall m . OpenAPI.Common.MonadHTTP m => SingleParamParametersStatus -- ^ status: Status values that need to be considered for filter -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response SingleParamResponse) -- ^ Monadic computation which returns the result of the operation -singleParam status = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either SingleParamResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) +singleParam status = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either SingleParamResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | Defines the enum schema located at @paths.\/pet\/singleparam.GET.parameters.[0].schema@ in the specification. -- -- Represents the parameter named \'status\' @@ -74,7 +74,7 @@ data SingleParamParametersStatus = | SingleParamParametersStatusEnumAvailable -- ^ Represents the JSON value @"available"@ | SingleParamParametersStatusEnumPending -- ^ Represents the JSON value @"pending"@ | SingleParamParametersStatusEnumSold -- ^ Represents the JSON value @"sold"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SingleParamParametersStatus where {toJSON (SingleParamParametersStatusOther val) = val; toJSON (SingleParamParametersStatusTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -82,17 +82,17 @@ instance Data.Aeson.Types.ToJSON.ToJSON SingleParamParametersStatus toJSON (SingleParamParametersStatusEnumPending) = "pending"; toJSON (SingleParamParametersStatusEnumSold) = "sold"} instance Data.Aeson.Types.FromJSON.FromJSON SingleParamParametersStatus - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "available" -> SingleParamParametersStatusEnumAvailable - | val GHC.Classes.== "pending" -> SingleParamParametersStatusEnumPending - | val GHC.Classes.== "sold" -> SingleParamParametersStatusEnumSold - | GHC.Base.otherwise -> SingleParamParametersStatusOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "available" -> SingleParamParametersStatusEnumAvailable + | val GHC.Classes.== "pending" -> SingleParamParametersStatusEnumPending + | val GHC.Classes.== "sold" -> SingleParamParametersStatusEnumSold + | GHC.Internal.Base.otherwise -> SingleParamParametersStatusOther val)} -- | Represents a response of the operation 'singleParam'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'SingleParamResponseError' is used. data SingleParamResponse = - SingleParamResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + SingleParamResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | SingleParamResponse200 Dog -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/singleparam -- -- The same as 'singleParam' but accepts an explicit configuration. @@ -100,15 +100,15 @@ singleParamWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI -> SingleParamParametersStatus -- ^ status: Status values that need to be considered for filter -> m (Network.HTTP.Client.Types.Response SingleParamResponse) -- ^ Monadic computation which returns the result of the operation singleParamWithConfiguration config - status = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either SingleParamResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) + status = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either SingleParamResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/singleparam -- -- The same as 'singleParam' but returns the raw 'Data.ByteString.ByteString'. singleParamRaw :: forall m . OpenAPI.Common.MonadHTTP m => SingleParamParametersStatus -- ^ status: Status values that need to be considered for filter -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -singleParamRaw status = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) +singleParamRaw status = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/singleparam -- -- The same as 'singleParam' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -116,4 +116,4 @@ singleParamWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => Open -> SingleParamParametersStatus -- ^ status: Status values that need to be considered for filter -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation singleParamWithConfigurationRaw config - status = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) + status = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparam" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "status") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON status) (Data.Text.Internal.pack "form") GHC.Types.False]) diff --git a/testing/golden-output/src/OpenAPI/Operations/SingleParamWithFixedEnum.hs b/testing/golden-output/src/OpenAPI/Operations/SingleParamWithFixedEnum.hs index f295ae6..4b95390 100755 --- a/testing/golden-output/src/OpenAPI/Operations/SingleParamWithFixedEnum.hs +++ b/testing/golden-output/src/OpenAPI/Operations/SingleParamWithFixedEnum.hs @@ -60,9 +60,9 @@ import OpenAPI.Types -- Operation with a single fixed parameter singleParamWithFixedEnum :: forall m . OpenAPI.Common.MonadHTTP m => SingleParamWithFixedEnumParametersFixedenumvalue -- ^ fixedenumvalue: A fixed value -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response SingleParamWithFixedEnumResponse) -- ^ Monadic computation which returns the result of the operation -singleParamWithFixedEnum fixedenumvalue = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either SingleParamWithFixedEnumResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamWithFixedEnumResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) +singleParamWithFixedEnum fixedenumvalue = GHC.Internal.Base.fmap (\response_0 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either SingleParamWithFixedEnumResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamWithFixedEnumResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | Defines the enum schema located at @paths.\/pet\/singleparamwithfixedenum.GET.parameters.[0].schema@ in the specification. -- -- Represents the parameter named \'fixedenumvalue\' @@ -72,21 +72,21 @@ data SingleParamWithFixedEnumParametersFixedenumvalue = SingleParamWithFixedEnumParametersFixedenumvalueOther Data.Aeson.Types.Internal.Value -- ^ This case is used if the value encountered during decoding does not match any of the provided cases in the specification. | SingleParamWithFixedEnumParametersFixedenumvalueTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | SingleParamWithFixedEnumParametersFixedenumvalueEnumThefixedvalue -- ^ Represents the JSON value @"thefixedvalue"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SingleParamWithFixedEnumParametersFixedenumvalue where {toJSON (SingleParamWithFixedEnumParametersFixedenumvalueOther val) = val; toJSON (SingleParamWithFixedEnumParametersFixedenumvalueTyped val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (SingleParamWithFixedEnumParametersFixedenumvalueEnumThefixedvalue) = "thefixedvalue"} instance Data.Aeson.Types.FromJSON.FromJSON SingleParamWithFixedEnumParametersFixedenumvalue - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "thefixedvalue" -> SingleParamWithFixedEnumParametersFixedenumvalueEnumThefixedvalue - | GHC.Base.otherwise -> SingleParamWithFixedEnumParametersFixedenumvalueOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "thefixedvalue" -> SingleParamWithFixedEnumParametersFixedenumvalueEnumThefixedvalue + | GHC.Internal.Base.otherwise -> SingleParamWithFixedEnumParametersFixedenumvalueOther val)} -- | Represents a response of the operation 'singleParamWithFixedEnum'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'SingleParamWithFixedEnumResponseError' is used. data SingleParamWithFixedEnumResponse = - SingleParamWithFixedEnumResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error + SingleParamWithFixedEnumResponseError GHC.Internal.Base.String -- ^ Means either no matching case available or a parse error | SingleParamWithFixedEnumResponse200 Dog -- ^ successful operation - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) -- | > GET /pet/singleparamwithfixedenum -- -- The same as 'singleParamWithFixedEnum' but accepts an explicit configuration. @@ -94,15 +94,15 @@ singleParamWithFixedEnumWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP -> SingleParamWithFixedEnumParametersFixedenumvalue -- ^ fixedenumvalue: A fixed value -> m (Network.HTTP.Client.Types.Response SingleParamWithFixedEnumResponse) -- ^ Monadic computation which returns the result of the operation singleParamWithFixedEnumWithConfiguration config - fixedenumvalue = GHC.Base.fmap (\response_2 -> GHC.Base.fmap (Data.Either.either SingleParamWithFixedEnumResponseError GHC.Base.id GHC.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamWithFixedEnumResponse200 Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String - Dog) - | GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) + fixedenumvalue = GHC.Internal.Base.fmap (\response_2 -> GHC.Internal.Base.fmap (GHC.Internal.Data.Either.either SingleParamWithFixedEnumResponseError GHC.Internal.Base.id GHC.Internal.Base.. (\response body -> if | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> SingleParamWithFixedEnumResponse200 GHC.Internal.Data.Functor.<$> (Data.Aeson.Decoding.eitherDecodeStrict body :: GHC.Internal.Data.Either.Either GHC.Internal.Base.String + Dog) + | GHC.Internal.Base.otherwise -> GHC.Internal.Data.Either.Left "Missing default response type") response_2) response_2) (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/singleparamwithfixedenum -- -- The same as 'singleParamWithFixedEnum' but returns the raw 'Data.ByteString.ByteString'. singleParamWithFixedEnumRaw :: forall m . OpenAPI.Common.MonadHTTP m => SingleParamWithFixedEnumParametersFixedenumvalue -- ^ fixedenumvalue: A fixed value -> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation -singleParamWithFixedEnumRaw fixedenumvalue = GHC.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) +singleParamWithFixedEnumRaw fixedenumvalue = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfigurationM (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) -- | > GET /pet/singleparamwithfixedenum -- -- The same as 'singleParamWithFixedEnum' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'. @@ -110,4 +110,4 @@ singleParamWithFixedEnumWithConfigurationRaw :: forall m . OpenAPI.Common.MonadH -> SingleParamWithFixedEnumParametersFixedenumvalue -- ^ fixedenumvalue: A fixed value -> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation singleParamWithFixedEnumWithConfigurationRaw config - fixedenumvalue = GHC.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Maybe.Just GHC.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) + fixedenumvalue = GHC.Internal.Base.id (OpenAPI.Common.doCallWithConfiguration config (Data.Text.toUpper GHC.Internal.Base.$ Data.Text.Internal.pack "GET") "/pet/singleparamwithfixedenum" [OpenAPI.Common.QueryParameter (Data.Text.Internal.pack "fixedenumvalue") (GHC.Internal.Maybe.Just GHC.Internal.Base.$ Data.Aeson.Types.ToJSON.toJSON fixedenumvalue) (Data.Text.Internal.pack "form") GHC.Types.False]) diff --git a/testing/golden-output/src/OpenAPI/SecuritySchemes.hs b/testing/golden-output/src/OpenAPI/SecuritySchemes.hs index 05a519b..2afc758 100755 --- a/testing/golden-output/src/OpenAPI/SecuritySchemes.hs +++ b/testing/golden-output/src/OpenAPI/SecuritySchemes.hs @@ -19,7 +19,7 @@ import qualified OpenAPI.Common data BasicAuthenticationData = BasicAuthenticationData {basicAuthenticationDataUsername :: Data.Text.Internal.Text, basicAuthenticationDataPassword :: Data.Text.Internal.Text} - deriving (GHC.Show.Show, GHC.Classes.Ord, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Ord, GHC.Classes.Eq) -- | Use this security scheme to use basic authentication for a request. Should be used in a 'OpenAPI.Common.Configuration'. -- @@ -36,7 +36,7 @@ data BasicAuthenticationData -- @ basicAuthenticationSecurityScheme :: BasicAuthenticationData -> OpenAPI.Common.SecurityScheme -basicAuthenticationSecurityScheme = \basicAuth_0 -> Network.HTTP.Client.Request.applyBasicAuth (OpenAPI.Common.textToByte GHC.Base.$ basicAuthenticationDataUsername basicAuth_0) (OpenAPI.Common.textToByte GHC.Base.$ basicAuthenticationDataPassword basicAuth_0) +basicAuthenticationSecurityScheme = \basicAuth_0 -> Network.HTTP.Client.Request.applyBasicAuth (OpenAPI.Common.textToByte GHC.Internal.Base.$ basicAuthenticationDataUsername basicAuth_0) (OpenAPI.Common.textToByte GHC.Internal.Base.$ basicAuthenticationDataPassword basicAuth_0) -- | Use this security scheme to use bearer authentication for a request. Should be used in a 'OpenAPI.Common.Configuration'. -- @@ -49,4 +49,4 @@ basicAuthenticationSecurityScheme = \basicAuth_0 -> Network.HTTP.Client.Request. -- @ bearerAuthenticationSecurityScheme :: Data.Text.Internal.Text -> OpenAPI.Common.SecurityScheme -bearerAuthenticationSecurityScheme = \token_1 -> Network.HTTP.Simple.addRequestHeader "Authorization" GHC.Base.$ (OpenAPI.Common.textToByte GHC.Base.$ ("Bearer " GHC.Base.<> token_1)) +bearerAuthenticationSecurityScheme = \token_1 -> Network.HTTP.Simple.addRequestHeader "Authorization" GHC.Internal.Base.$ (OpenAPI.Common.textToByte GHC.Internal.Base.$ ("Bearer " GHC.Internal.Base.<> token_1)) diff --git a/testing/golden-output/src/OpenAPI/TypeAlias.hs b/testing/golden-output/src/OpenAPI/TypeAlias.hs index afd0c25..3c0b8f2 100755 --- a/testing/golden-output/src/OpenAPI/TypeAlias.hs +++ b/testing/golden-output/src/OpenAPI/TypeAlias.hs @@ -66,7 +66,7 @@ type Test2 = [Data.Text.Internal.Text] -- | Defines an alias for the schema located at @components.schemas.Test10@ in the specification. -- -- -type Test10 = GHC.Base.NonEmpty Data.Text.Internal.Text +type Test10 = GHC.Internal.Base.NonEmpty Data.Text.Internal.Text -- | Defines an alias for the schema located at @components.schemas.Test@ in the specification. -- diff --git a/testing/golden-output/src/OpenAPI/Types/Cat.hs b/testing/golden-output/src/OpenAPI/Types/Cat.hs index 4dc2ab2..2c8925f 100755 --- a/testing/golden-output/src/OpenAPI/Types/Cat.hs +++ b/testing/golden-output/src/OpenAPI/Types/Cat.hs @@ -47,26 +47,26 @@ import {-# SOURCE #-} OpenAPI.Types.PetByType -- data Cat = Cat { -- | age - catAge :: (GHC.Maybe.Maybe GHC.Types.Int) + catAge :: (GHC.Internal.Maybe.Maybe GHC.Types.Int) -- | another_relative - , catAnother_relative :: (GHC.Maybe.Maybe CatAnother_relativeVariants) + , catAnother_relative :: (GHC.Internal.Maybe.Maybe CatAnother_relativeVariants) -- | hunts - , catHunts :: (GHC.Maybe.Maybe GHC.Types.Bool) + , catHunts :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | relative - , catRelative :: (GHC.Maybe.Maybe CatRelativeVariants) - } deriving (GHC.Show.Show + , catRelative :: (GHC.Internal.Maybe.Maybe CatRelativeVariants) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Cat - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (catAge obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (catAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (catHunts obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (catRelative obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (catAge obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (catAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (catHunts obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (catRelative obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (catAge obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (catAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (catHunts obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (catRelative obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (catAge obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (catAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (catHunts obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (catRelative obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Cat - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Cat" (\obj -> (((GHC.Base.pure Cat GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "age")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Cat" (\obj -> (((GHC.Internal.Base.pure Cat GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "age")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} -- | Create a new 'Cat' with all required fields. mkCat :: Cat -mkCat = Cat{catAge = GHC.Maybe.Nothing, - catAnother_relative = GHC.Maybe.Nothing, - catHunts = GHC.Maybe.Nothing, - catRelative = GHC.Maybe.Nothing} +mkCat = Cat{catAge = GHC.Internal.Maybe.Nothing, + catAnother_relative = GHC.Internal.Maybe.Nothing, + catHunts = GHC.Internal.Maybe.Nothing, + catRelative = GHC.Internal.Maybe.Nothing} -- | Defines the oneOf schema located at @components.schemas.Cat.properties.another_relative.oneOf@ in the specification. -- -- @@ -74,15 +74,15 @@ data CatAnother_relativeVariants = CatAnother_relativeCat Cat | CatAnother_relativePetByType PetByType | CatAnother_relativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON CatAnother_relativeVariants where {toJSON (CatAnother_relativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (CatAnother_relativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (CatAnother_relativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON CatAnother_relativeVariants - where {parseJSON val = case (CatAnother_relativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CatAnother_relativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CatAnother_relativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (CatAnother_relativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CatAnother_relativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CatAnother_relativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Defines the oneOf schema located at @components.schemas.Cat.properties.relative.anyOf@ in the specification. -- -- @@ -90,12 +90,12 @@ data CatRelativeVariants = CatRelativeCat Cat | CatRelativePetByType PetByType | CatRelativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON CatRelativeVariants where {toJSON (CatRelativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (CatRelativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (CatRelativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON CatRelativeVariants - where {parseJSON val = case (CatRelativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CatRelativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CatRelativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (CatRelativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CatRelativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CatRelativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} diff --git a/testing/golden-output/src/OpenAPI/Types/CoverType.hs b/testing/golden-output/src/OpenAPI/Types/CoverType.hs index 5464bb2..e5b474d 100755 --- a/testing/golden-output/src/OpenAPI/Types/CoverType.hs +++ b/testing/golden-output/src/OpenAPI/Types/CoverType.hs @@ -53,17 +53,17 @@ import {-# SOURCE #-} OpenAPI.Types.Value -- data CoverType = CoverType { -- | cover - coverTypeCover :: (GHC.Maybe.Maybe CoverTypeCoverVariants) - } deriving (GHC.Show.Show + coverTypeCover :: (GHC.Internal.Maybe.Maybe CoverTypeCoverVariants) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON CoverType - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("cover" Data.Aeson.Types.ToJSON..=)) (coverTypeCover obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("cover" Data.Aeson.Types.ToJSON..=)) (coverTypeCover obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("cover" Data.Aeson.Types.ToJSON..=)) (coverTypeCover obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("cover" Data.Aeson.Types.ToJSON..=)) (coverTypeCover obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON CoverType - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "CoverType" (\obj -> GHC.Base.pure CoverType GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "cover"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "CoverType" (\obj -> GHC.Internal.Base.pure CoverType GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "cover"))} -- | Create a new 'CoverType' with all required fields. mkCoverType :: CoverType -mkCoverType = CoverType{coverTypeCover = GHC.Maybe.Nothing} +mkCoverType = CoverType{coverTypeCover = GHC.Internal.Maybe.Nothing} -- | Defines the oneOf schema located at @components.schemas.CoverType.properties.cover.oneOf@ in the specification. -- -- @@ -81,7 +81,7 @@ data CoverTypeCoverVariants = | CoverTypeCoverTest9 Test9 | CoverTypeCoverTest10 Test10 | CoverTypeCoverValue Value - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON CoverTypeCoverVariants where {toJSON (CoverTypeCoverPetByAge a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (CoverTypeCoverMischling a) = Data.Aeson.Types.ToJSON.toJSON a; @@ -97,6 +97,6 @@ instance Data.Aeson.Types.ToJSON.ToJSON CoverTypeCoverVariants toJSON (CoverTypeCoverTest10 a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (CoverTypeCoverValue a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON CoverTypeCoverVariants - where {parseJSON val = case (CoverTypeCoverPetByAge Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverMischling Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest2 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest3 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest4 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest5 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest6 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest7 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest8 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest9 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverTest10 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((CoverTypeCoverValue Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")))))))))))) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (CoverTypeCoverPetByAge GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverMischling GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest2 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest3 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest4 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest5 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest6 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest7 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest8 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest9 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverTest10 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((CoverTypeCoverValue GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")))))))))))) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} diff --git a/testing/golden-output/src/OpenAPI/Types/Dog.hs b/testing/golden-output/src/OpenAPI/Types/Dog.hs index 4a9cbc8..c063050 100755 --- a/testing/golden-output/src/OpenAPI/Types/Dog.hs +++ b/testing/golden-output/src/OpenAPI/Types/Dog.hs @@ -46,78 +46,78 @@ import OpenAPI.TypeAlias -- data Dog = Dog { -- | bark - dogBark :: (GHC.Maybe.Maybe GHC.Types.Bool) + dogBark :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | binary - , dogBinary :: (GHC.Maybe.Maybe OpenAPI.Common.JsonByteString) + , dogBinary :: (GHC.Internal.Maybe.Maybe OpenAPI.Common.JsonByteString) -- | breed - , dogBreed :: (GHC.Maybe.Maybe DogBreed) + , dogBreed :: (GHC.Internal.Maybe.Maybe DogBreed) -- | byte - , dogByte :: (GHC.Maybe.Maybe OpenAPI.Common.JsonByteString) + , dogByte :: (GHC.Internal.Maybe.Maybe OpenAPI.Common.JsonByteString) -- | double - , dogDouble :: (GHC.Maybe.Maybe GHC.Types.Double) + , dogDouble :: (GHC.Internal.Maybe.Maybe GHC.Types.Double) -- | father - , dogFather :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object) + , dogFather :: (GHC.Internal.Maybe.Maybe Data.Aeson.Types.Internal.Object) -- | float -- -- Constraints: -- -- * Must be a multiple of 1.0e-2 - , dogFloat :: (GHC.Maybe.Maybe GHC.Types.Float) + , dogFloat :: (GHC.Internal.Maybe.Maybe GHC.Types.Float) -- | int32 - , dogInt32 :: (GHC.Maybe.Maybe GHC.Int.Int32) + , dogInt32 :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int32) -- | int64 -- -- Constraints: -- -- * Must be a multiple of 4.0 - , dogInt64 :: (GHC.Maybe.Maybe GHC.Int.Int64) + , dogInt64 :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | integer - , dogInteger :: (GHC.Maybe.Maybe GHC.Types.Int) + , dogInteger :: (GHC.Internal.Maybe.Maybe GHC.Types.Int) -- | number - , dogNumber :: (GHC.Maybe.Maybe GHC.Types.Double) + , dogNumber :: (GHC.Internal.Maybe.Maybe GHC.Types.Double) -- | pet_type - , dogPet_type :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object) + , dogPet_type :: (GHC.Internal.Maybe.Maybe Data.Aeson.Types.Internal.Object) -- | secondFather - , dogSecondFather :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object) + , dogSecondFather :: (GHC.Internal.Maybe.Maybe Data.Aeson.Types.Internal.Object) -- | str -- -- Constraints: -- -- * Maximum length of 244 -- * Minimum length of 100 - , dogStr :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , dogStr :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | strDate - , dogStrDate :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , dogStrDate :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | strDateTime - , dogStrDateTime :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , dogStrDateTime :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | tags - , dogTags :: (GHC.Maybe.Maybe [Data.Text.Internal.Text]) - } deriving (GHC.Show.Show + , dogTags :: (GHC.Internal.Maybe.Maybe [Data.Text.Internal.Text]) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Dog - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (dogBark obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (dogBinary obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (dogBreed obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (dogByte obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (dogDouble obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (dogFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (dogFloat obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (dogInt32 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (dogInt64 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (dogInteger obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (dogNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (dogPet_type obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (dogSecondFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (dogStr obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (dogStrDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (dogStrDateTime obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (dogTags obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (dogBark obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (dogBinary obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (dogBreed obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (dogByte obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (dogDouble obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (dogFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (dogFloat obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (dogInt32 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (dogInt64 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (dogInteger obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (dogNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (dogPet_type obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (dogSecondFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (dogStr obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (dogStrDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (dogStrDateTime obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (dogTags obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (dogBark obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (dogBinary obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (dogBreed obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (dogByte obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (dogDouble obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (dogFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (dogFloat obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (dogInt32 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (dogInt64 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (dogInteger obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (dogNumber obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (dogPet_type obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (dogSecondFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (dogStr obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (dogStrDate obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (dogStrDateTime obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (dogTags obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (dogBark obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (dogBinary obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (dogBreed obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (dogByte obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (dogDouble obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (dogFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (dogFloat obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (dogInt32 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (dogInt64 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (dogInteger obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (dogNumber obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (dogPet_type obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (dogSecondFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (dogStr obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (dogStrDate obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (dogStrDateTime obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (dogTags obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Dog - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Dog" (\obj -> ((((((((((((((((GHC.Base.pure Dog GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bark")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "binary")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "breed")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "byte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "double")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "father")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "float")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int32")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int64")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "integer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "secondFather")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "str")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDate")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDateTime")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tags"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Dog" (\obj -> ((((((((((((((((GHC.Internal.Base.pure Dog GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bark")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "binary")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "breed")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "byte")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "double")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "father")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "float")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int32")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int64")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "integer")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "number")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "secondFather")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "str")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDate")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDateTime")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tags"))} -- | Create a new 'Dog' with all required fields. mkDog :: Dog -mkDog = Dog{dogBark = GHC.Maybe.Nothing, - dogBinary = GHC.Maybe.Nothing, - dogBreed = GHC.Maybe.Nothing, - dogByte = GHC.Maybe.Nothing, - dogDouble = GHC.Maybe.Nothing, - dogFather = GHC.Maybe.Nothing, - dogFloat = GHC.Maybe.Nothing, - dogInt32 = GHC.Maybe.Nothing, - dogInt64 = GHC.Maybe.Nothing, - dogInteger = GHC.Maybe.Nothing, - dogNumber = GHC.Maybe.Nothing, - dogPet_type = GHC.Maybe.Nothing, - dogSecondFather = GHC.Maybe.Nothing, - dogStr = GHC.Maybe.Nothing, - dogStrDate = GHC.Maybe.Nothing, - dogStrDateTime = GHC.Maybe.Nothing, - dogTags = GHC.Maybe.Nothing} +mkDog = Dog{dogBark = GHC.Internal.Maybe.Nothing, + dogBinary = GHC.Internal.Maybe.Nothing, + dogBreed = GHC.Internal.Maybe.Nothing, + dogByte = GHC.Internal.Maybe.Nothing, + dogDouble = GHC.Internal.Maybe.Nothing, + dogFather = GHC.Internal.Maybe.Nothing, + dogFloat = GHC.Internal.Maybe.Nothing, + dogInt32 = GHC.Internal.Maybe.Nothing, + dogInt64 = GHC.Internal.Maybe.Nothing, + dogInteger = GHC.Internal.Maybe.Nothing, + dogNumber = GHC.Internal.Maybe.Nothing, + dogPet_type = GHC.Internal.Maybe.Nothing, + dogSecondFather = GHC.Internal.Maybe.Nothing, + dogStr = GHC.Internal.Maybe.Nothing, + dogStrDate = GHC.Internal.Maybe.Nothing, + dogStrDateTime = GHC.Internal.Maybe.Nothing, + dogTags = GHC.Internal.Maybe.Nothing} -- | Defines the enum schema located at @components.schemas.Dog.properties.breed@ in the specification. -- -- @@ -128,7 +128,7 @@ data DogBreed = | DogBreedEnumHusky -- ^ Represents the JSON value @"Husky"@ | DogBreedEnumRetriever -- ^ Represents the JSON value @"Retriever"@ | DogBreedEnumShepherd -- ^ Represents the JSON value @"Shepherd"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON DogBreed where {toJSON (DogBreedOther val) = val; toJSON (DogBreedTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -137,8 +137,8 @@ instance Data.Aeson.Types.ToJSON.ToJSON DogBreed toJSON (DogBreedEnumRetriever) = "Retriever"; toJSON (DogBreedEnumShepherd) = "Shepherd"} instance Data.Aeson.Types.FromJSON.FromJSON DogBreed - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "Dingo" -> DogBreedEnumDingo - | val GHC.Classes.== "Husky" -> DogBreedEnumHusky - | val GHC.Classes.== "Retriever" -> DogBreedEnumRetriever - | val GHC.Classes.== "Shepherd" -> DogBreedEnumShepherd - | GHC.Base.otherwise -> DogBreedOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "Dingo" -> DogBreedEnumDingo + | val GHC.Classes.== "Husky" -> DogBreedEnumHusky + | val GHC.Classes.== "Retriever" -> DogBreedEnumRetriever + | val GHC.Classes.== "Shepherd" -> DogBreedEnumShepherd + | GHC.Internal.Base.otherwise -> DogBreedOther val)} diff --git a/testing/golden-output/src/OpenAPI/Types/Mischling.hs b/testing/golden-output/src/OpenAPI/Types/Mischling.hs index 2cc400c..660f096 100755 --- a/testing/golden-output/src/OpenAPI/Types/Mischling.hs +++ b/testing/golden-output/src/OpenAPI/Types/Mischling.hs @@ -52,130 +52,130 @@ data Mischling = Mischling { -- | age mischlingAge :: GHC.Types.Int -- | ageThird - , mischlingAgeThird :: (GHC.Maybe.Maybe GHC.Types.Int) + , mischlingAgeThird :: (GHC.Internal.Maybe.Maybe GHC.Types.Int) -- | another_relative - , mischlingAnother_relative :: (GHC.Maybe.Maybe MischlingAnother_relativeVariants) + , mischlingAnother_relative :: (GHC.Internal.Maybe.Maybe MischlingAnother_relativeVariants) -- | bark - , mischlingBark :: (GHC.Maybe.Maybe GHC.Types.Bool) + , mischlingBark :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | binary - , mischlingBinary :: (GHC.Maybe.Maybe OpenAPI.Common.JsonByteString) + , mischlingBinary :: (GHC.Internal.Maybe.Maybe OpenAPI.Common.JsonByteString) -- | breed - , mischlingBreed :: (GHC.Maybe.Maybe MischlingBreed) + , mischlingBreed :: (GHC.Internal.Maybe.Maybe MischlingBreed) -- | byte - , mischlingByte :: (GHC.Maybe.Maybe OpenAPI.Common.JsonByteString) + , mischlingByte :: (GHC.Internal.Maybe.Maybe OpenAPI.Common.JsonByteString) -- | double - , mischlingDouble :: (GHC.Maybe.Maybe GHC.Types.Double) + , mischlingDouble :: (GHC.Internal.Maybe.Maybe GHC.Types.Double) -- | father - , mischlingFather :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object) + , mischlingFather :: (GHC.Internal.Maybe.Maybe Data.Aeson.Types.Internal.Object) -- | first_relative - , mischlingFirst_relative :: (GHC.Maybe.Maybe MischlingFirst_relative) + , mischlingFirst_relative :: (GHC.Internal.Maybe.Maybe MischlingFirst_relative) -- | float -- -- Constraints: -- -- * Must be a multiple of 1.0e-2 - , mischlingFloat :: (GHC.Maybe.Maybe GHC.Types.Float) + , mischlingFloat :: (GHC.Internal.Maybe.Maybe GHC.Types.Float) -- | huntssecond - , mischlingHuntssecond :: (GHC.Maybe.Maybe GHC.Types.Bool) + , mischlingHuntssecond :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | int32 - , mischlingInt32 :: (GHC.Maybe.Maybe GHC.Int.Int32) + , mischlingInt32 :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int32) -- | int64 -- -- Constraints: -- -- * Must be a multiple of 4.0 - , mischlingInt64 :: (GHC.Maybe.Maybe GHC.Int.Int64) + , mischlingInt64 :: (GHC.Internal.Maybe.Maybe GHC.Internal.Int.Int64) -- | integer - , mischlingInteger :: (GHC.Maybe.Maybe GHC.Types.Int) + , mischlingInteger :: (GHC.Internal.Maybe.Maybe GHC.Types.Int) -- | nickname - , mischlingNickname :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , mischlingNickname :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | number - , mischlingNumber :: (GHC.Maybe.Maybe GHC.Types.Double) + , mischlingNumber :: (GHC.Internal.Maybe.Maybe GHC.Types.Double) -- | pet_type - , mischlingPet_type :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object) + , mischlingPet_type :: (GHC.Internal.Maybe.Maybe Data.Aeson.Types.Internal.Object) -- | relative - , mischlingRelative :: (GHC.Maybe.Maybe MischlingRelativeVariants) + , mischlingRelative :: (GHC.Internal.Maybe.Maybe MischlingRelativeVariants) -- | secondFather - , mischlingSecondFather :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object) + , mischlingSecondFather :: (GHC.Internal.Maybe.Maybe Data.Aeson.Types.Internal.Object) -- | str -- -- Constraints: -- -- * Maximum length of 244 -- * Minimum length of 100 - , mischlingStr :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , mischlingStr :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | strDate - , mischlingStrDate :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , mischlingStrDate :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | strDateTime - , mischlingStrDateTime :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , mischlingStrDateTime :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | tags - , mischlingTags :: (GHC.Maybe.Maybe [Data.Text.Internal.Text]) - } deriving (GHC.Show.Show + , mischlingTags :: (GHC.Internal.Maybe.Maybe [Data.Text.Internal.Text]) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Mischling - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= mischlingAge obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("ageThird" Data.Aeson.Types.ToJSON..=)) (mischlingAgeThird obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (mischlingBark obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (mischlingBinary obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (mischlingBreed obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (mischlingByte obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (mischlingDouble obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (mischlingFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (mischlingFloat obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("huntssecond" Data.Aeson.Types.ToJSON..=)) (mischlingHuntssecond obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (mischlingInt32 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (mischlingInt64 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (mischlingInteger obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (mischlingNickname obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (mischlingNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingPet_type obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingRelative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (mischlingSecondFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (mischlingStr obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (mischlingStrDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (mischlingStrDateTime obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (mischlingTags obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= mischlingAge obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("ageThird" Data.Aeson.Types.ToJSON..=)) (mischlingAgeThird obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (mischlingBark obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (mischlingBinary obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (mischlingBreed obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (mischlingByte obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (mischlingDouble obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (mischlingFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (mischlingFloat obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("huntssecond" Data.Aeson.Types.ToJSON..=)) (mischlingHuntssecond obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (mischlingInt32 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (mischlingInt64 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (mischlingInteger obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (mischlingNickname obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (mischlingNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingPet_type obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingRelative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (mischlingSecondFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (mischlingStr obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (mischlingStrDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (mischlingStrDateTime obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (mischlingTags obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= mischlingAge obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("ageThird" Data.Aeson.Types.ToJSON..=)) (mischlingAgeThird obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (mischlingBark obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (mischlingBinary obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (mischlingBreed obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (mischlingByte obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (mischlingDouble obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (mischlingFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (mischlingFloat obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("huntssecond" Data.Aeson.Types.ToJSON..=)) (mischlingHuntssecond obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (mischlingInt32 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (mischlingInt64 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (mischlingInteger obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (mischlingNickname obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (mischlingNumber obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingPet_type obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingRelative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (mischlingSecondFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (mischlingStr obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (mischlingStrDate obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (mischlingStrDateTime obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (mischlingTags obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= mischlingAge obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("ageThird" Data.Aeson.Types.ToJSON..=)) (mischlingAgeThird obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (mischlingBark obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (mischlingBinary obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (mischlingBreed obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (mischlingByte obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (mischlingDouble obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (mischlingFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (mischlingFloat obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("huntssecond" Data.Aeson.Types.ToJSON..=)) (mischlingHuntssecond obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (mischlingInt32 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (mischlingInt64 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (mischlingInteger obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (mischlingNickname obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (mischlingNumber obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingPet_type obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingRelative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (mischlingSecondFather obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (mischlingStr obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (mischlingStrDate obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (mischlingStrDateTime obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (mischlingTags obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Mischling - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Mischling" (\obj -> (((((((((((((((((((((((GHC.Base.pure Mischling GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "age")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "ageThird")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bark")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "binary")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "breed")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "byte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "double")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "father")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "first_relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "float")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "huntssecond")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int32")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int64")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "integer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "nickname")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "secondFather")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "str")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDate")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDateTime")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tags"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Mischling" (\obj -> (((((((((((((((((((((((GHC.Internal.Base.pure Mischling GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "age")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "ageThird")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bark")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "binary")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "breed")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "byte")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "double")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "father")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "first_relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "float")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "huntssecond")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int32")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int64")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "integer")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "nickname")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "number")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "secondFather")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "str")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDate")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDateTime")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tags"))} -- | Create a new 'Mischling' with all required fields. mkMischling :: GHC.Types.Int -- ^ 'mischlingAge' -> Mischling mkMischling mischlingAge = Mischling{mischlingAge = mischlingAge, - mischlingAgeThird = GHC.Maybe.Nothing, - mischlingAnother_relative = GHC.Maybe.Nothing, - mischlingBark = GHC.Maybe.Nothing, - mischlingBinary = GHC.Maybe.Nothing, - mischlingBreed = GHC.Maybe.Nothing, - mischlingByte = GHC.Maybe.Nothing, - mischlingDouble = GHC.Maybe.Nothing, - mischlingFather = GHC.Maybe.Nothing, - mischlingFirst_relative = GHC.Maybe.Nothing, - mischlingFloat = GHC.Maybe.Nothing, - mischlingHuntssecond = GHC.Maybe.Nothing, - mischlingInt32 = GHC.Maybe.Nothing, - mischlingInt64 = GHC.Maybe.Nothing, - mischlingInteger = GHC.Maybe.Nothing, - mischlingNickname = GHC.Maybe.Nothing, - mischlingNumber = GHC.Maybe.Nothing, - mischlingPet_type = GHC.Maybe.Nothing, - mischlingRelative = GHC.Maybe.Nothing, - mischlingSecondFather = GHC.Maybe.Nothing, - mischlingStr = GHC.Maybe.Nothing, - mischlingStrDate = GHC.Maybe.Nothing, - mischlingStrDateTime = GHC.Maybe.Nothing, - mischlingTags = GHC.Maybe.Nothing} + mischlingAgeThird = GHC.Internal.Maybe.Nothing, + mischlingAnother_relative = GHC.Internal.Maybe.Nothing, + mischlingBark = GHC.Internal.Maybe.Nothing, + mischlingBinary = GHC.Internal.Maybe.Nothing, + mischlingBreed = GHC.Internal.Maybe.Nothing, + mischlingByte = GHC.Internal.Maybe.Nothing, + mischlingDouble = GHC.Internal.Maybe.Nothing, + mischlingFather = GHC.Internal.Maybe.Nothing, + mischlingFirst_relative = GHC.Internal.Maybe.Nothing, + mischlingFloat = GHC.Internal.Maybe.Nothing, + mischlingHuntssecond = GHC.Internal.Maybe.Nothing, + mischlingInt32 = GHC.Internal.Maybe.Nothing, + mischlingInt64 = GHC.Internal.Maybe.Nothing, + mischlingInteger = GHC.Internal.Maybe.Nothing, + mischlingNickname = GHC.Internal.Maybe.Nothing, + mischlingNumber = GHC.Internal.Maybe.Nothing, + mischlingPet_type = GHC.Internal.Maybe.Nothing, + mischlingRelative = GHC.Internal.Maybe.Nothing, + mischlingSecondFather = GHC.Internal.Maybe.Nothing, + mischlingStr = GHC.Internal.Maybe.Nothing, + mischlingStrDate = GHC.Internal.Maybe.Nothing, + mischlingStrDateTime = GHC.Internal.Maybe.Nothing, + mischlingTags = GHC.Internal.Maybe.Nothing} -- | Defines the object schema located at @components.schemas.Mischling.allOf.properties.another_relative.oneOf@ in the specification. -- -- data MischlingAnother_relativeOneOf5 = MischlingAnother_relativeOneOf5 { -- | hunts - mischlingAnother_relativeOneOf5Hunts :: (GHC.Maybe.Maybe GHC.Types.Bool) + mischlingAnother_relativeOneOf5Hunts :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | pet_type - , mischlingAnother_relativeOneOf5Pet_type :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , mischlingAnother_relativeOneOf5Pet_type :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingAnother_relativeOneOf5 - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Hunts obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Pet_type obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Hunts obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Pet_type obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Hunts obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Pet_type obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Hunts obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (mischlingAnother_relativeOneOf5Pet_type obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON MischlingAnother_relativeOneOf5 - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MischlingAnother_relativeOneOf5" (\obj -> (GHC.Base.pure MischlingAnother_relativeOneOf5 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MischlingAnother_relativeOneOf5" (\obj -> (GHC.Internal.Base.pure MischlingAnother_relativeOneOf5 GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type"))} -- | Create a new 'MischlingAnother_relativeOneOf5' with all required fields. mkMischlingAnother_relativeOneOf5 :: MischlingAnother_relativeOneOf5 -mkMischlingAnother_relativeOneOf5 = MischlingAnother_relativeOneOf5{mischlingAnother_relativeOneOf5Hunts = GHC.Maybe.Nothing, - mischlingAnother_relativeOneOf5Pet_type = GHC.Maybe.Nothing} +mkMischlingAnother_relativeOneOf5 = MischlingAnother_relativeOneOf5{mischlingAnother_relativeOneOf5Hunts = GHC.Internal.Maybe.Nothing, + mischlingAnother_relativeOneOf5Pet_type = GHC.Internal.Maybe.Nothing} -- | Defines the object schema located at @components.schemas.Mischling.allOf.properties.another_relative.oneOf@ in the specification. -- -- data MischlingAnother_relativeAnother_cat = MischlingAnother_relativeAnother_cat { -- | another_cat mischlingAnother_relativeAnother_catAnother_cat :: Cat - } deriving (GHC.Show.Show + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingAnother_relativeAnother_cat - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= mischlingAnother_relativeAnother_catAnother_cat obj] : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= mischlingAnother_relativeAnother_catAnother_cat obj] : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= mischlingAnother_relativeAnother_catAnother_cat obj] : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= mischlingAnother_relativeAnother_catAnother_cat obj] : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON MischlingAnother_relativeAnother_cat - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MischlingAnother_relativeAnother_cat" (\obj -> GHC.Base.pure MischlingAnother_relativeAnother_cat GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "another_cat"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MischlingAnother_relativeAnother_cat" (\obj -> GHC.Internal.Base.pure MischlingAnother_relativeAnother_cat GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "another_cat"))} -- | Create a new 'MischlingAnother_relativeAnother_cat' with all required fields. mkMischlingAnother_relativeAnother_cat :: Cat -- ^ 'mischlingAnother_relativeAnother_catAnother_cat' -> MischlingAnother_relativeAnother_cat @@ -192,7 +192,7 @@ data MischlingAnother_relativeVariants = | MischlingAnother_relativeListTText [Data.Text.Internal.Text] | MischlingAnother_relativeMischlingAnother_relativeOneOf5 MischlingAnother_relativeOneOf5 | MischlingAnother_relativeMischlingAnother_relativeAnother_cat MischlingAnother_relativeAnother_cat - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingAnother_relativeVariants where {toJSON (MischlingAnother_relativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (MischlingAnother_relativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; @@ -203,11 +203,11 @@ instance Data.Aeson.Types.ToJSON.ToJSON MischlingAnother_relativeVariants toJSON (MischlingAnother_relativeEmptyString) = ""; toJSON (MischlingAnother_relativeTest) = "test"} instance Data.Aeson.Types.FromJSON.FromJSON MischlingAnother_relativeVariants - where {parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure MischlingAnother_relativeEmptyString - | val GHC.Classes.== "test" -> GHC.Base.pure MischlingAnother_relativeTest - | GHC.Base.otherwise -> case (MischlingAnother_relativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingAnother_relativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingAnother_relativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingAnother_relativeListTText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingAnother_relativeMischlingAnother_relativeOneOf5 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingAnother_relativeMischlingAnother_relativeAnother_cat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched"))))) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = if | val GHC.Classes.== "" -> GHC.Internal.Base.pure MischlingAnother_relativeEmptyString + | val GHC.Classes.== "test" -> GHC.Internal.Base.pure MischlingAnother_relativeTest + | GHC.Internal.Base.otherwise -> case (MischlingAnother_relativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingAnother_relativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingAnother_relativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingAnother_relativeListTText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingAnother_relativeMischlingAnother_relativeOneOf5 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingAnother_relativeMischlingAnother_relativeAnother_cat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched"))))) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Defines the enum schema located at @components.schemas.Mischling.allOf.properties.breed@ in the specification. -- -- @@ -218,7 +218,7 @@ data MischlingBreed = | MischlingBreedEnumHusky -- ^ Represents the JSON value @"Husky"@ | MischlingBreedEnumRetriever -- ^ Represents the JSON value @"Retriever"@ | MischlingBreedEnumShepherd -- ^ Represents the JSON value @"Shepherd"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingBreed where {toJSON (MischlingBreedOther val) = val; toJSON (MischlingBreedTyped val) = Data.Aeson.Types.ToJSON.toJSON val; @@ -227,40 +227,40 @@ instance Data.Aeson.Types.ToJSON.ToJSON MischlingBreed toJSON (MischlingBreedEnumRetriever) = "Retriever"; toJSON (MischlingBreedEnumShepherd) = "Shepherd"} instance Data.Aeson.Types.FromJSON.FromJSON MischlingBreed - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "Dingo" -> MischlingBreedEnumDingo - | val GHC.Classes.== "Husky" -> MischlingBreedEnumHusky - | val GHC.Classes.== "Retriever" -> MischlingBreedEnumRetriever - | val GHC.Classes.== "Shepherd" -> MischlingBreedEnumShepherd - | GHC.Base.otherwise -> MischlingBreedOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "Dingo" -> MischlingBreedEnumDingo + | val GHC.Classes.== "Husky" -> MischlingBreedEnumHusky + | val GHC.Classes.== "Retriever" -> MischlingBreedEnumRetriever + | val GHC.Classes.== "Shepherd" -> MischlingBreedEnumShepherd + | GHC.Internal.Base.otherwise -> MischlingBreedOther val)} -- | Defines the object schema located at @components.schemas.Mischling.allOf.properties.first_relative.allOf@ in the specification. -- -- data MischlingFirst_relative = MischlingFirst_relative { -- | age - mischlingFirst_relativeAge :: (GHC.Maybe.Maybe GHC.Types.Int) + mischlingFirst_relativeAge :: (GHC.Internal.Maybe.Maybe GHC.Types.Int) -- | another_relative - , mischlingFirst_relativeAnother_relative :: (GHC.Maybe.Maybe MischlingFirst_relativeAnother_relativeVariants) + , mischlingFirst_relativeAnother_relative :: (GHC.Internal.Maybe.Maybe MischlingFirst_relativeAnother_relativeVariants) -- | hunts - , mischlingFirst_relativeHunts :: (GHC.Maybe.Maybe GHC.Types.Bool) + , mischlingFirst_relativeHunts :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | pet_type , mischlingFirst_relativePet_type :: MischlingFirst_relativePet_type -- | relative - , mischlingFirst_relativeRelative :: (GHC.Maybe.Maybe MischlingFirst_relativeRelativeVariants) - } deriving (GHC.Show.Show + , mischlingFirst_relativeRelative :: (GHC.Internal.Maybe.Maybe MischlingFirst_relativeRelativeVariants) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingFirst_relative - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAge obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= mischlingFirst_relativePet_type obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeRelative obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAge obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= mischlingFirst_relativePet_type obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeRelative obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAge obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= mischlingFirst_relativePet_type obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeRelative obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAge obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= mischlingFirst_relativePet_type obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (mischlingFirst_relativeRelative obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON MischlingFirst_relative - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MischlingFirst_relative" (\obj -> ((((GHC.Base.pure MischlingFirst_relative GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "age")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pet_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "MischlingFirst_relative" (\obj -> ((((GHC.Internal.Base.pure MischlingFirst_relative GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "age")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pet_type")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} -- | Create a new 'MischlingFirst_relative' with all required fields. mkMischlingFirst_relative :: MischlingFirst_relativePet_type -- ^ 'mischlingFirst_relativePet_type' -> MischlingFirst_relative -mkMischlingFirst_relative mischlingFirst_relativePet_type = MischlingFirst_relative{mischlingFirst_relativeAge = GHC.Maybe.Nothing, - mischlingFirst_relativeAnother_relative = GHC.Maybe.Nothing, - mischlingFirst_relativeHunts = GHC.Maybe.Nothing, +mkMischlingFirst_relative mischlingFirst_relativePet_type = MischlingFirst_relative{mischlingFirst_relativeAge = GHC.Internal.Maybe.Nothing, + mischlingFirst_relativeAnother_relative = GHC.Internal.Maybe.Nothing, + mischlingFirst_relativeHunts = GHC.Internal.Maybe.Nothing, mischlingFirst_relativePet_type = mischlingFirst_relativePet_type, - mischlingFirst_relativeRelative = GHC.Maybe.Nothing} + mischlingFirst_relativeRelative = GHC.Internal.Maybe.Nothing} -- | Defines the oneOf schema located at @components.schemas.Mischling.allOf.properties.first_relative.allOf.properties.another_relative.oneOf@ in the specification. -- -- @@ -268,15 +268,15 @@ data MischlingFirst_relativeAnother_relativeVariants = MischlingFirst_relativeAnother_relativeCat Cat | MischlingFirst_relativeAnother_relativePetByType PetByType | MischlingFirst_relativeAnother_relativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingFirst_relativeAnother_relativeVariants where {toJSON (MischlingFirst_relativeAnother_relativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (MischlingFirst_relativeAnother_relativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (MischlingFirst_relativeAnother_relativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON MischlingFirst_relativeAnother_relativeVariants - where {parseJSON val = case (MischlingFirst_relativeAnother_relativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingFirst_relativeAnother_relativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingFirst_relativeAnother_relativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (MischlingFirst_relativeAnother_relativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingFirst_relativeAnother_relativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingFirst_relativeAnother_relativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Defines the enum schema located at @components.schemas.Mischling.allOf.properties.first_relative.allOf.properties.pet_type@ in the specification. -- -- @@ -285,16 +285,16 @@ data MischlingFirst_relativePet_type = | MischlingFirst_relativePet_typeTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | MischlingFirst_relativePet_typeEnumCat -- ^ Represents the JSON value @"Cat"@ | MischlingFirst_relativePet_typeEnumDog -- ^ Represents the JSON value @"Dog"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingFirst_relativePet_type where {toJSON (MischlingFirst_relativePet_typeOther val) = val; toJSON (MischlingFirst_relativePet_typeTyped val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (MischlingFirst_relativePet_typeEnumCat) = "Cat"; toJSON (MischlingFirst_relativePet_typeEnumDog) = "Dog"} instance Data.Aeson.Types.FromJSON.FromJSON MischlingFirst_relativePet_type - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "Cat" -> MischlingFirst_relativePet_typeEnumCat - | val GHC.Classes.== "Dog" -> MischlingFirst_relativePet_typeEnumDog - | GHC.Base.otherwise -> MischlingFirst_relativePet_typeOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "Cat" -> MischlingFirst_relativePet_typeEnumCat + | val GHC.Classes.== "Dog" -> MischlingFirst_relativePet_typeEnumDog + | GHC.Internal.Base.otherwise -> MischlingFirst_relativePet_typeOther val)} -- | Defines the oneOf schema located at @components.schemas.Mischling.allOf.properties.first_relative.allOf.properties.relative.anyOf@ in the specification. -- -- @@ -302,15 +302,15 @@ data MischlingFirst_relativeRelativeVariants = MischlingFirst_relativeRelativeCat Cat | MischlingFirst_relativeRelativePetByType PetByType | MischlingFirst_relativeRelativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingFirst_relativeRelativeVariants where {toJSON (MischlingFirst_relativeRelativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (MischlingFirst_relativeRelativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (MischlingFirst_relativeRelativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON MischlingFirst_relativeRelativeVariants - where {parseJSON val = case (MischlingFirst_relativeRelativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingFirst_relativeRelativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingFirst_relativeRelativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (MischlingFirst_relativeRelativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingFirst_relativeRelativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingFirst_relativeRelativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Defines the oneOf schema located at @components.schemas.Mischling.allOf.properties.relative.anyOf@ in the specification. -- -- @@ -318,12 +318,12 @@ data MischlingRelativeVariants = MischlingRelativeCat Cat | MischlingRelativePetByType PetByType | MischlingRelativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON MischlingRelativeVariants where {toJSON (MischlingRelativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (MischlingRelativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (MischlingRelativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON MischlingRelativeVariants - where {parseJSON val = case (MischlingRelativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingRelativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((MischlingRelativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (MischlingRelativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingRelativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((MischlingRelativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} diff --git a/testing/golden-output/src/OpenAPI/Types/PetByAge.hs b/testing/golden-output/src/OpenAPI/Types/PetByAge.hs index 7405570..0e8580b 100755 --- a/testing/golden-output/src/OpenAPI/Types/PetByAge.hs +++ b/testing/golden-output/src/OpenAPI/Types/PetByAge.hs @@ -50,60 +50,60 @@ data PetByAge = PetByAge { -- | age petByAgeAge :: GHC.Types.Int -- | another_relative - , petByAgeAnother_relative :: (GHC.Maybe.Maybe PetByAgeAnother_relativeVariants) + , petByAgeAnother_relative :: (GHC.Internal.Maybe.Maybe PetByAgeAnother_relativeVariants) -- | first_relative - , petByAgeFirst_relative :: (GHC.Maybe.Maybe PetByAgeFirst_relative) + , petByAgeFirst_relative :: (GHC.Internal.Maybe.Maybe PetByAgeFirst_relative) -- | nickname - , petByAgeNickname :: (GHC.Maybe.Maybe Data.Text.Internal.Text) + , petByAgeNickname :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) -- | relative - , petByAgeRelative :: (GHC.Maybe.Maybe PetByAgeRelativeVariants) - } deriving (GHC.Show.Show + , petByAgeRelative :: (GHC.Internal.Maybe.Maybe PetByAgeRelativeVariants) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAge - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= petByAgeAge obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (petByAgeNickname obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeRelative obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= petByAgeAge obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (petByAgeNickname obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeRelative obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= petByAgeAge obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (petByAgeNickname obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeRelative obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["age" Data.Aeson.Types.ToJSON..= petByAgeAge obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("first_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (petByAgeNickname obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeRelative obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON PetByAge - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAge" (\obj -> ((((GHC.Base.pure PetByAge GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "age")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "first_relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "nickname")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAge" (\obj -> ((((GHC.Internal.Base.pure PetByAge GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "age")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "first_relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "nickname")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} -- | Create a new 'PetByAge' with all required fields. mkPetByAge :: GHC.Types.Int -- ^ 'petByAgeAge' -> PetByAge mkPetByAge petByAgeAge = PetByAge{petByAgeAge = petByAgeAge, - petByAgeAnother_relative = GHC.Maybe.Nothing, - petByAgeFirst_relative = GHC.Maybe.Nothing, - petByAgeNickname = GHC.Maybe.Nothing, - petByAgeRelative = GHC.Maybe.Nothing} + petByAgeAnother_relative = GHC.Internal.Maybe.Nothing, + petByAgeFirst_relative = GHC.Internal.Maybe.Nothing, + petByAgeNickname = GHC.Internal.Maybe.Nothing, + petByAgeRelative = GHC.Internal.Maybe.Nothing} -- | Defines the object schema located at @components.schemas.PetByAge.properties.another_relative.oneOf@ in the specification. -- -- data PetByAgeAnother_relativeOneOf5 = PetByAgeAnother_relativeOneOf5 { -- | hunts - petByAgeAnother_relativeOneOf5Hunts :: (GHC.Maybe.Maybe GHC.Types.Bool) + petByAgeAnother_relativeOneOf5Hunts :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | pet_type - , petByAgeAnother_relativeOneOf5Pet_type :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , petByAgeAnother_relativeOneOf5Pet_type :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeAnother_relativeOneOf5 - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Hunts obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Pet_type obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Hunts obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Pet_type obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Hunts obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Pet_type obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Hunts obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (petByAgeAnother_relativeOneOf5Pet_type obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeAnother_relativeOneOf5 - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAgeAnother_relativeOneOf5" (\obj -> (GHC.Base.pure PetByAgeAnother_relativeOneOf5 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAgeAnother_relativeOneOf5" (\obj -> (GHC.Internal.Base.pure PetByAgeAnother_relativeOneOf5 GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type"))} -- | Create a new 'PetByAgeAnother_relativeOneOf5' with all required fields. mkPetByAgeAnother_relativeOneOf5 :: PetByAgeAnother_relativeOneOf5 -mkPetByAgeAnother_relativeOneOf5 = PetByAgeAnother_relativeOneOf5{petByAgeAnother_relativeOneOf5Hunts = GHC.Maybe.Nothing, - petByAgeAnother_relativeOneOf5Pet_type = GHC.Maybe.Nothing} +mkPetByAgeAnother_relativeOneOf5 = PetByAgeAnother_relativeOneOf5{petByAgeAnother_relativeOneOf5Hunts = GHC.Internal.Maybe.Nothing, + petByAgeAnother_relativeOneOf5Pet_type = GHC.Internal.Maybe.Nothing} -- | Defines the object schema located at @components.schemas.PetByAge.properties.another_relative.oneOf@ in the specification. -- -- data PetByAgeAnother_relativeAnother_cat = PetByAgeAnother_relativeAnother_cat { -- | another_cat petByAgeAnother_relativeAnother_catAnother_cat :: Cat - } deriving (GHC.Show.Show + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeAnother_relativeAnother_cat - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= petByAgeAnother_relativeAnother_catAnother_cat obj] : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= petByAgeAnother_relativeAnother_catAnother_cat obj] : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= petByAgeAnother_relativeAnother_catAnother_cat obj] : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["another_cat" Data.Aeson.Types.ToJSON..= petByAgeAnother_relativeAnother_catAnother_cat obj] : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeAnother_relativeAnother_cat - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAgeAnother_relativeAnother_cat" (\obj -> GHC.Base.pure PetByAgeAnother_relativeAnother_cat GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "another_cat"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAgeAnother_relativeAnother_cat" (\obj -> GHC.Internal.Base.pure PetByAgeAnother_relativeAnother_cat GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "another_cat"))} -- | Create a new 'PetByAgeAnother_relativeAnother_cat' with all required fields. mkPetByAgeAnother_relativeAnother_cat :: Cat -- ^ 'petByAgeAnother_relativeAnother_catAnother_cat' -> PetByAgeAnother_relativeAnother_cat @@ -120,7 +120,7 @@ data PetByAgeAnother_relativeVariants = | PetByAgeAnother_relativeListTText [Data.Text.Internal.Text] | PetByAgeAnother_relativePetByAgeAnother_relativeOneOf5 PetByAgeAnother_relativeOneOf5 | PetByAgeAnother_relativePetByAgeAnother_relativeAnother_cat PetByAgeAnother_relativeAnother_cat - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeAnother_relativeVariants where {toJSON (PetByAgeAnother_relativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (PetByAgeAnother_relativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; @@ -131,40 +131,40 @@ instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeAnother_relativeVariants toJSON (PetByAgeAnother_relativeEmptyString) = ""; toJSON (PetByAgeAnother_relativeTest) = "test"} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeAnother_relativeVariants - where {parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PetByAgeAnother_relativeEmptyString - | val GHC.Classes.== "test" -> GHC.Base.pure PetByAgeAnother_relativeTest - | GHC.Base.otherwise -> case (PetByAgeAnother_relativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeAnother_relativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeAnother_relativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeAnother_relativeListTText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeAnother_relativePetByAgeAnother_relativeOneOf5 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeAnother_relativePetByAgeAnother_relativeAnother_cat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched"))))) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = if | val GHC.Classes.== "" -> GHC.Internal.Base.pure PetByAgeAnother_relativeEmptyString + | val GHC.Classes.== "test" -> GHC.Internal.Base.pure PetByAgeAnother_relativeTest + | GHC.Internal.Base.otherwise -> case (PetByAgeAnother_relativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeAnother_relativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeAnother_relativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeAnother_relativeListTText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeAnother_relativePetByAgeAnother_relativeOneOf5 GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeAnother_relativePetByAgeAnother_relativeAnother_cat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched"))))) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Defines the object schema located at @components.schemas.PetByAge.properties.first_relative.allOf@ in the specification. -- -- data PetByAgeFirst_relative = PetByAgeFirst_relative { -- | age - petByAgeFirst_relativeAge :: (GHC.Maybe.Maybe GHC.Types.Int) + petByAgeFirst_relativeAge :: (GHC.Internal.Maybe.Maybe GHC.Types.Int) -- | another_relative - , petByAgeFirst_relativeAnother_relative :: (GHC.Maybe.Maybe PetByAgeFirst_relativeAnother_relativeVariants) + , petByAgeFirst_relativeAnother_relative :: (GHC.Internal.Maybe.Maybe PetByAgeFirst_relativeAnother_relativeVariants) -- | hunts - , petByAgeFirst_relativeHunts :: (GHC.Maybe.Maybe GHC.Types.Bool) + , petByAgeFirst_relativeHunts :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | pet_type , petByAgeFirst_relativePet_type :: PetByAgeFirst_relativePet_type -- | relative - , petByAgeFirst_relativeRelative :: (GHC.Maybe.Maybe PetByAgeFirst_relativeRelativeVariants) - } deriving (GHC.Show.Show + , petByAgeFirst_relativeRelative :: (GHC.Internal.Maybe.Maybe PetByAgeFirst_relativeRelativeVariants) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeFirst_relative - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAge obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByAgeFirst_relativePet_type obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeRelative obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAge obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAnother_relative obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByAgeFirst_relativePet_type obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeRelative obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAge obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByAgeFirst_relativePet_type obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeRelative obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("age" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAge obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("another_relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeAnother_relative obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByAgeFirst_relativePet_type obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("relative" Data.Aeson.Types.ToJSON..=)) (petByAgeFirst_relativeRelative obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeFirst_relative - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAgeFirst_relative" (\obj -> ((((GHC.Base.pure PetByAgeFirst_relative GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "age")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pet_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByAgeFirst_relative" (\obj -> ((((GHC.Internal.Base.pure PetByAgeFirst_relative GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "age")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "another_relative")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pet_type")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "relative"))} -- | Create a new 'PetByAgeFirst_relative' with all required fields. mkPetByAgeFirst_relative :: PetByAgeFirst_relativePet_type -- ^ 'petByAgeFirst_relativePet_type' -> PetByAgeFirst_relative -mkPetByAgeFirst_relative petByAgeFirst_relativePet_type = PetByAgeFirst_relative{petByAgeFirst_relativeAge = GHC.Maybe.Nothing, - petByAgeFirst_relativeAnother_relative = GHC.Maybe.Nothing, - petByAgeFirst_relativeHunts = GHC.Maybe.Nothing, +mkPetByAgeFirst_relative petByAgeFirst_relativePet_type = PetByAgeFirst_relative{petByAgeFirst_relativeAge = GHC.Internal.Maybe.Nothing, + petByAgeFirst_relativeAnother_relative = GHC.Internal.Maybe.Nothing, + petByAgeFirst_relativeHunts = GHC.Internal.Maybe.Nothing, petByAgeFirst_relativePet_type = petByAgeFirst_relativePet_type, - petByAgeFirst_relativeRelative = GHC.Maybe.Nothing} + petByAgeFirst_relativeRelative = GHC.Internal.Maybe.Nothing} -- | Defines the oneOf schema located at @components.schemas.PetByAge.properties.first_relative.allOf.properties.another_relative.oneOf@ in the specification. -- -- @@ -172,15 +172,15 @@ data PetByAgeFirst_relativeAnother_relativeVariants = PetByAgeFirst_relativeAnother_relativeCat Cat | PetByAgeFirst_relativeAnother_relativePetByType PetByType | PetByAgeFirst_relativeAnother_relativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeFirst_relativeAnother_relativeVariants where {toJSON (PetByAgeFirst_relativeAnother_relativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (PetByAgeFirst_relativeAnother_relativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (PetByAgeFirst_relativeAnother_relativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeFirst_relativeAnother_relativeVariants - where {parseJSON val = case (PetByAgeFirst_relativeAnother_relativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeFirst_relativeAnother_relativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeFirst_relativeAnother_relativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (PetByAgeFirst_relativeAnother_relativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeFirst_relativeAnother_relativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeFirst_relativeAnother_relativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Defines the enum schema located at @components.schemas.PetByAge.properties.first_relative.allOf.properties.pet_type@ in the specification. -- -- @@ -189,16 +189,16 @@ data PetByAgeFirst_relativePet_type = | PetByAgeFirst_relativePet_typeTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | PetByAgeFirst_relativePet_typeEnumCat -- ^ Represents the JSON value @"Cat"@ | PetByAgeFirst_relativePet_typeEnumDog -- ^ Represents the JSON value @"Dog"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeFirst_relativePet_type where {toJSON (PetByAgeFirst_relativePet_typeOther val) = val; toJSON (PetByAgeFirst_relativePet_typeTyped val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (PetByAgeFirst_relativePet_typeEnumCat) = "Cat"; toJSON (PetByAgeFirst_relativePet_typeEnumDog) = "Dog"} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeFirst_relativePet_type - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "Cat" -> PetByAgeFirst_relativePet_typeEnumCat - | val GHC.Classes.== "Dog" -> PetByAgeFirst_relativePet_typeEnumDog - | GHC.Base.otherwise -> PetByAgeFirst_relativePet_typeOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "Cat" -> PetByAgeFirst_relativePet_typeEnumCat + | val GHC.Classes.== "Dog" -> PetByAgeFirst_relativePet_typeEnumDog + | GHC.Internal.Base.otherwise -> PetByAgeFirst_relativePet_typeOther val)} -- | Defines the oneOf schema located at @components.schemas.PetByAge.properties.first_relative.allOf.properties.relative.anyOf@ in the specification. -- -- @@ -206,15 +206,15 @@ data PetByAgeFirst_relativeRelativeVariants = PetByAgeFirst_relativeRelativeCat Cat | PetByAgeFirst_relativeRelativePetByType PetByType | PetByAgeFirst_relativeRelativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeFirst_relativeRelativeVariants where {toJSON (PetByAgeFirst_relativeRelativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (PetByAgeFirst_relativeRelativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (PetByAgeFirst_relativeRelativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeFirst_relativeRelativeVariants - where {parseJSON val = case (PetByAgeFirst_relativeRelativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeFirst_relativeRelativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeFirst_relativeRelativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (PetByAgeFirst_relativeRelativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeFirst_relativeRelativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeFirst_relativeRelativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} -- | Defines the oneOf schema located at @components.schemas.PetByAge.properties.relative.anyOf@ in the specification. -- -- @@ -222,12 +222,12 @@ data PetByAgeRelativeVariants = PetByAgeRelativeCat Cat | PetByAgeRelativePetByType PetByType | PetByAgeRelativeText Data.Text.Internal.Text - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByAgeRelativeVariants where {toJSON (PetByAgeRelativeCat a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (PetByAgeRelativePetByType a) = Data.Aeson.Types.ToJSON.toJSON a; toJSON (PetByAgeRelativeText a) = Data.Aeson.Types.ToJSON.toJSON a} instance Data.Aeson.Types.FromJSON.FromJSON PetByAgeRelativeVariants - where {parseJSON val = case (PetByAgeRelativeCat Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeRelativePetByType Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PetByAgeRelativeText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of - {Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a; - Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a}} + where {parseJSON val = case (PetByAgeRelativeCat GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeRelativePetByType GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> ((PetByAgeRelativeText GHC.Internal.Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Internal.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of + {Data.Aeson.Types.Internal.Success a -> GHC.Internal.Base.pure a; + Data.Aeson.Types.Internal.Error a -> GHC.Internal.Control.Monad.Fail.fail a}} diff --git a/testing/golden-output/src/OpenAPI/Types/PetByType.hs b/testing/golden-output/src/OpenAPI/Types/PetByType.hs index da1feb9..307fcda 100755 --- a/testing/golden-output/src/OpenAPI/Types/PetByType.hs +++ b/testing/golden-output/src/OpenAPI/Types/PetByType.hs @@ -46,20 +46,20 @@ import OpenAPI.TypeAlias -- data PetByType = PetByType { -- | hunts - petByTypeHunts :: (GHC.Maybe.Maybe GHC.Types.Bool) + petByTypeHunts :: (GHC.Internal.Maybe.Maybe GHC.Types.Bool) -- | pet_type , petByTypePet_type :: PetByTypePet_type - } deriving (GHC.Show.Show + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByType - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByTypeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByTypePet_type obj] : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByTypeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByTypePet_type obj] : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByTypeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByTypePet_type obj] : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("hunts" Data.Aeson.Types.ToJSON..=)) (petByTypeHunts obj) : ["pet_type" Data.Aeson.Types.ToJSON..= petByTypePet_type obj] : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON PetByType - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByType" (\obj -> (GHC.Base.pure PetByType GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pet_type"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "PetByType" (\obj -> (GHC.Internal.Base.pure PetByType GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "hunts")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "pet_type"))} -- | Create a new 'PetByType' with all required fields. mkPetByType :: PetByTypePet_type -- ^ 'petByTypePet_type' -> PetByType -mkPetByType petByTypePet_type = PetByType{petByTypeHunts = GHC.Maybe.Nothing, +mkPetByType petByTypePet_type = PetByType{petByTypeHunts = GHC.Internal.Maybe.Nothing, petByTypePet_type = petByTypePet_type} -- | Defines the enum schema located at @components.schemas.PetByType.properties.pet_type@ in the specification. -- @@ -69,13 +69,13 @@ data PetByTypePet_type = | PetByTypePet_typeTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | PetByTypePet_typeEnumCat -- ^ Represents the JSON value @"Cat"@ | PetByTypePet_typeEnumDog -- ^ Represents the JSON value @"Dog"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PetByTypePet_type where {toJSON (PetByTypePet_typeOther val) = val; toJSON (PetByTypePet_typeTyped val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (PetByTypePet_typeEnumCat) = "Cat"; toJSON (PetByTypePet_typeEnumDog) = "Dog"} instance Data.Aeson.Types.FromJSON.FromJSON PetByTypePet_type - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "Cat" -> PetByTypePet_typeEnumCat - | val GHC.Classes.== "Dog" -> PetByTypePet_typeEnumDog - | GHC.Base.otherwise -> PetByTypePet_typeOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "Cat" -> PetByTypePet_typeEnumCat + | val GHC.Classes.== "Dog" -> PetByTypePet_typeEnumDog + | GHC.Internal.Base.otherwise -> PetByTypePet_typeOther val)} diff --git a/testing/golden-output/src/OpenAPI/Types/Test6.hs b/testing/golden-output/src/OpenAPI/Types/Test6.hs index 93a695d..3f4932f 100755 --- a/testing/golden-output/src/OpenAPI/Types/Test6.hs +++ b/testing/golden-output/src/OpenAPI/Types/Test6.hs @@ -49,13 +49,13 @@ data Test6 = | Test6Typed Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | Test6EnumHello -- ^ Represents the JSON value @"hello"@ | Test6EnumThere -- ^ Represents the JSON value @"there"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Test6 where {toJSON (Test6Other val) = val; toJSON (Test6Typed val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (Test6EnumHello) = "hello"; toJSON (Test6EnumThere) = "there"} instance Data.Aeson.Types.FromJSON.FromJSON Test6 - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "hello" -> Test6EnumHello - | val GHC.Classes.== "there" -> Test6EnumThere - | GHC.Base.otherwise -> Test6Other val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "hello" -> Test6EnumHello + | val GHC.Classes.== "there" -> Test6EnumThere + | GHC.Internal.Base.otherwise -> Test6Other val)} diff --git a/testing/golden-output/src/OpenAPI/Types/Test7.hs b/testing/golden-output/src/OpenAPI/Types/Test7.hs index 9fb86e5..9903eee 100755 --- a/testing/golden-output/src/OpenAPI/Types/Test7.hs +++ b/testing/golden-output/src/OpenAPI/Types/Test7.hs @@ -46,20 +46,20 @@ import OpenAPI.TypeAlias -- data Test7Item = Test7Item { -- | prop1 - test7ItemProp1 :: (GHC.Maybe.Maybe GHC.Types.Int) + test7ItemProp1 :: (GHC.Internal.Maybe.Maybe GHC.Types.Int) -- | prop2 - , test7ItemProp2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text) - } deriving (GHC.Show.Show + , test7ItemProp2 :: (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text) + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Test7Item - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("prop1" Data.Aeson.Types.ToJSON..=)) (test7ItemProp1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test7ItemProp2 obj) : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("prop1" Data.Aeson.Types.ToJSON..=)) (test7ItemProp1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test7ItemProp2 obj) : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("prop1" Data.Aeson.Types.ToJSON..=)) (test7ItemProp1 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test7ItemProp2 obj) : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("prop1" Data.Aeson.Types.ToJSON..=)) (test7ItemProp1 obj) : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test7ItemProp2 obj) : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Test7Item - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Test7Item" (\obj -> (GHC.Base.pure Test7Item GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "prop1")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "prop2"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Test7Item" (\obj -> (GHC.Internal.Base.pure Test7Item GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "prop1")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "prop2"))} -- | Create a new 'Test7Item' with all required fields. mkTest7Item :: Test7Item -mkTest7Item = Test7Item{test7ItemProp1 = GHC.Maybe.Nothing, - test7ItemProp2 = GHC.Maybe.Nothing} +mkTest7Item = Test7Item{test7ItemProp1 = GHC.Internal.Maybe.Nothing, + test7ItemProp2 = GHC.Internal.Maybe.Nothing} -- | Defines an alias for the schema located at @components.schemas.Test7@ in the specification. -- -- diff --git a/testing/golden-output/src/OpenAPI/Types/Test8.hs b/testing/golden-output/src/OpenAPI/Types/Test8.hs index ff31160..95b36a6 100755 --- a/testing/golden-output/src/OpenAPI/Types/Test8.hs +++ b/testing/golden-output/src/OpenAPI/Types/Test8.hs @@ -48,22 +48,22 @@ data Test8NonNullable = Test8NonNullable { -- | prop1 test8NonNullableProp1 :: (OpenAPI.Common.Nullable GHC.Types.Int) -- | prop2 - , test8NonNullableProp2 :: (GHC.Maybe.Maybe (OpenAPI.Common.Nullable Data.Text.Internal.Text)) + , test8NonNullableProp2 :: (GHC.Internal.Maybe.Maybe (OpenAPI.Common.Nullable Data.Text.Internal.Text)) -- | prop3 , test8NonNullableProp3 :: (OpenAPI.Common.Nullable [OpenAPI.Common.Nullable Data.Text.Internal.Text]) - } deriving (GHC.Show.Show + } deriving (GHC.Internal.Show.Show , GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Test8NonNullable - where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["prop1" Data.Aeson.Types.ToJSON..= test8NonNullableProp1 obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test8NonNullableProp2 obj) : ["prop3" Data.Aeson.Types.ToJSON..= test8NonNullableProp3 obj] : GHC.Base.mempty)); - toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["prop1" Data.Aeson.Types.ToJSON..= test8NonNullableProp1 obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test8NonNullableProp2 obj) : ["prop3" Data.Aeson.Types.ToJSON..= test8NonNullableProp3 obj] : GHC.Base.mempty)))} + where {toJSON obj = Data.Aeson.Types.Internal.object (GHC.Internal.Data.Foldable.concat (["prop1" Data.Aeson.Types.ToJSON..= test8NonNullableProp1 obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test8NonNullableProp2 obj) : ["prop3" Data.Aeson.Types.ToJSON..= test8NonNullableProp3 obj] : GHC.Internal.Base.mempty)); + toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Internal.Base.mconcat (GHC.Internal.Data.Foldable.concat (["prop1" Data.Aeson.Types.ToJSON..= test8NonNullableProp1 obj] : GHC.Internal.Data.Maybe.maybe GHC.Internal.Base.mempty (GHC.Internal.Base.pure GHC.Internal.Base.. ("prop2" Data.Aeson.Types.ToJSON..=)) (test8NonNullableProp2 obj) : ["prop3" Data.Aeson.Types.ToJSON..= test8NonNullableProp3 obj] : GHC.Internal.Base.mempty)))} instance Data.Aeson.Types.FromJSON.FromJSON Test8NonNullable - where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Test8NonNullable" (\obj -> ((GHC.Base.pure Test8NonNullable GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "prop1")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "prop2")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "prop3"))} + where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Test8NonNullable" (\obj -> ((GHC.Internal.Base.pure Test8NonNullable GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "prop1")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "prop2")) GHC.Internal.Base.<*> (obj Data.Aeson.Types.FromJSON..: "prop3"))} -- | Create a new 'Test8NonNullable' with all required fields. mkTest8NonNullable :: OpenAPI.Common.Nullable GHC.Types.Int -- ^ 'test8NonNullableProp1' -> OpenAPI.Common.Nullable [OpenAPI.Common.Nullable Data.Text.Internal.Text] -- ^ 'test8NonNullableProp3' -> Test8NonNullable mkTest8NonNullable test8NonNullableProp1 test8NonNullableProp3 = Test8NonNullable{test8NonNullableProp1 = test8NonNullableProp1, - test8NonNullableProp2 = GHC.Maybe.Nothing, + test8NonNullableProp2 = GHC.Internal.Maybe.Nothing, test8NonNullableProp3 = test8NonNullableProp3} -- | Defines a nullable type alias for 'Test8NonNullable' as the schema located at @components.schemas.Test8@ in the specification is marked as nullable. type Test8 = OpenAPI.Common.Nullable Test8NonNullable diff --git a/testing/golden-output/src/OpenAPI/Types/Test9.hs b/testing/golden-output/src/OpenAPI/Types/Test9.hs index 324a847..e0d0f39 100755 --- a/testing/golden-output/src/OpenAPI/Types/Test9.hs +++ b/testing/golden-output/src/OpenAPI/Types/Test9.hs @@ -48,11 +48,11 @@ data Test9 = Test9Other Data.Aeson.Types.Internal.Value -- ^ This case is used if the value encountered during decoding does not match any of the provided cases in the specification. | Test9Typed Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | Test9EnumXxx -- ^ Represents the JSON value @"xxx"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Test9 where {toJSON (Test9Other val) = val; toJSON (Test9Typed val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (Test9EnumXxx) = "xxx"} instance Data.Aeson.Types.FromJSON.FromJSON Test9 - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "xxx" -> Test9EnumXxx - | GHC.Base.otherwise -> Test9Other val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "xxx" -> Test9EnumXxx + | GHC.Internal.Base.otherwise -> Test9Other val)} diff --git a/testing/golden-output/src/OpenAPI/Types/Value.hs b/testing/golden-output/src/OpenAPI/Types/Value.hs index b6d523c..1ec656d 100755 --- a/testing/golden-output/src/OpenAPI/Types/Value.hs +++ b/testing/golden-output/src/OpenAPI/Types/Value.hs @@ -48,11 +48,11 @@ data Value = ValueOther Data.Aeson.Types.Internal.Value -- ^ This case is used if the value encountered during decoding does not match any of the provided cases in the specification. | ValueTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet. | ValueEnumYyy -- ^ Represents the JSON value @"yyy"@ - deriving (GHC.Show.Show, GHC.Classes.Eq) + deriving (GHC.Internal.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Value where {toJSON (ValueOther val) = val; toJSON (ValueTyped val) = Data.Aeson.Types.ToJSON.toJSON val; toJSON (ValueEnumYyy) = "yyy"} instance Data.Aeson.Types.FromJSON.FromJSON Value - where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "yyy" -> ValueEnumYyy - | GHC.Base.otherwise -> ValueOther val)} + where {parseJSON val = GHC.Internal.Base.pure (if | val GHC.Classes.== "yyy" -> ValueEnumYyy + | GHC.Internal.Base.otherwise -> ValueOther val)}