diff --git a/openapi3-code-generator/src/OpenAPI/Generate/Types/Schema.hs b/openapi3-code-generator/src/OpenAPI/Generate/Types/Schema.hs index c798626..0f02564 100644 --- a/openapi3-code-generator/src/OpenAPI/Generate/Types/Schema.hs +++ b/openapi3-code-generator/src/OpenAPI/Generate/Types/Schema.hs @@ -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, diff --git a/specifications/z_complex_self_made_example.yml b/specifications/z_complex_self_made_example.yml index 0206b59..4e9b4bc 100644 --- a/specifications/z_complex_self_made_example.yml +++ b/specifications/z_complex_self_made_example.yml @@ -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 diff --git a/testing/golden-output/src/OpenAPI/Types/Dog.hs b/testing/golden-output/src/OpenAPI/Types/Dog.hs index 488f91b..d3763ce 100755 --- a/testing/golden-output/src/OpenAPI/Types/Dog.hs +++ b/testing/golden-output/src/OpenAPI/Types/Dog.hs @@ -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) diff --git a/testing/golden-output/src/OpenAPI/Types/Mischling.hs b/testing/golden-output/src/OpenAPI/Types/Mischling.hs index 91ca147..4359a27 100755 --- a/testing/golden-output/src/OpenAPI/Types/Mischling.hs +++ b/testing/golden-output/src/OpenAPI/Types/Mischling.hs @@ -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)