Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipleOf and Data.Text import fix #95

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openapi3-code-generator/src/OpenAPI/Generate/Doc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ addOperationsModuleHeader mainModuleName moduleName operationId =
. importQualified "Data.Maybe"
. importQualified "Data.Scientific"
. importQualified "Data.Text"
. importQualified "Data.Text.Internal"
. importQualified "Data.Text as Data.Text.Internal"
. importQualified "Data.Time.Calendar as Data.Time.Calendar.Days"
. importQualified "Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime"
. importQualified "Data.Vector"
Expand Down Expand Up @@ -255,7 +255,7 @@ addModelModuleHeader mainModuleName moduleName modelModulesToImport description
. importQualified "Data.Maybe"
. importQualified "Data.Scientific"
. importQualified "Data.Text"
. importQualified "Data.Text.Internal"
. importQualified "Data.Text as Data.Text.Internal"
. importQualified "Data.Time.Calendar as Data.Time.Calendar.Days"
. importQualified "Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime"
. importQualified "GHC.Base"
Expand All @@ -277,7 +277,7 @@ addSecuritySchemesModuleHeader moduleName =
. moduleDescription "Contains all supported security schemes defined in the specification"
. moduleDeclaration moduleName "SecuritySchemes"
. emptyLine
. importQualified "Data.Text.Internal"
. importQualified "Data.Text as Data.Text.Internal"
. importQualified "GHC.Base"
. importQualified "GHC.Classes"
. importQualified "GHC.Show"
Expand All @@ -296,7 +296,7 @@ addConfigurationModuleHeader moduleName =
. moduleDeclaration moduleName "Configuration"
. emptyLine
. importQualified "Data.Text"
. importQualified "Data.Text.Internal"
. importQualified "Data.Text as Data.Text.Internal"
. importQualified "GHC.Types "
. importQualified (moduleName <> ".Common")
. emptyLine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Schema = Referencable SchemaObject
data SchemaObject = SchemaObject
{ schemaObjectType :: SchemaType,
schemaObjectTitle :: Maybe Text,
schemaObjectMultipleOf :: Maybe Integer,
schemaObjectMultipleOf :: Maybe Float,
schemaObjectMaximum :: Maybe Float,
schemaObjectExclusiveMaximum :: Bool,
schemaObjectMinimum :: Maybe Float,
Expand Down
2 changes: 2 additions & 0 deletions specifications/z_complex_self_made_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@ components:
int64:
type: integer
format: int64
multipleOf: 4
number:
type: number
float:
type: number
format: float
multipleOf: 0.01
double:
type: number
format: double
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module OpenAPI.Configuration where

import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified GHC.Types
import qualified OpenAPI.Common

Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Operations/MultiParam.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Operations/NoParam.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Operations/Patch_pets.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/SecuritySchemes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- | Contains all supported security schemes defined in the specification
module OpenAPI.SecuritySchemes where

import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Show
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/TypeAlias.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/Cat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/CoverType.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
10 changes: 9 additions & 1 deletion testing/golden-output/src/OpenAPI/Types/Dog.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down Expand Up @@ -50,10 +50,18 @@ data Dog = Dog {
-- | father
, dogFather :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object)
-- | float
--
-- Constraints:
--
-- * Must be a multiple of 1.0e-2
, dogFloat :: (GHC.Maybe.Maybe GHC.Types.Float)
-- | int32
, dogInt32 :: (GHC.Maybe.Maybe GHC.Int.Int32)
-- | int64
--
-- Constraints:
--
-- * Must be a multiple of 4.0
, dogInt64 :: (GHC.Maybe.Maybe GHC.Int.Int64)
-- | integer
, dogInteger :: (GHC.Maybe.Maybe GHC.Types.Int)
Expand Down
10 changes: 9 additions & 1 deletion testing/golden-output/src/OpenAPI/Types/Mischling.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down Expand Up @@ -62,12 +62,20 @@ data Mischling = Mischling {
-- | first_relative
, mischlingFirst_relative :: (GHC.Maybe.Maybe MischlingFirst_relative)
-- | float
--
-- Constraints:
--
-- * Must be a multiple of 1.0e-2
, mischlingFloat :: (GHC.Maybe.Maybe GHC.Types.Float)
-- | huntssecond
, mischlingHuntssecond :: (GHC.Maybe.Maybe GHC.Types.Bool)
-- | int32
, mischlingInt32 :: (GHC.Maybe.Maybe GHC.Int.Int32)
-- | int64
--
-- Constraints:
--
-- * Must be a multiple of 4.0
, mischlingInt64 :: (GHC.Maybe.Maybe GHC.Int.Int64)
-- | integer
, mischlingInteger :: (GHC.Maybe.Maybe GHC.Types.Int)
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/PetByAge.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/PetByType.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/Test6.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/Test7.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/Test8.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
2 changes: 1 addition & 1 deletion testing/golden-output/src/OpenAPI/Types/Test9.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
Expand Down
Loading