10
Views
4
Comments
Why does Outsytems Swagger API documentation show decimals as double?

The data type double does not exist in Outsystems but in the Swagger documentation a decimal is shown as data type double, :

Swagger does not have a default decimal format under the number data type, but it is possible to generate a custom format, example:

type: number
format: decimal

https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers

I assume this is just a bug in the way the documentation is generated or is there a particular reason for this?

2025-03-01 14-31-55
Mihai Melencu

Hi Andre,

I don't believe this is a bug, just a conversion from the OutSystems type to the supported data types of OpenAPI's swagger.

You can check the supported types here: Data Types | Swagger Docs


2018-08-04 18-19-00
André Pinho

Sorry I just added this to my original post... the format can be set to a custom description, why not have decimal, rather than map to double that does not even exist in Outsystems.

2023-10-16 05-50-48
Shingo Lam

IMO, OpenAI's API specifications and underlying technologies generally do not have a dedicated, exact "decimal" data type. But it just uses the floating-point called number, we can treat it as Decimal in Outsystems, decimal in Python, Decimal in C#, etc

So, it doesn't matter the data type name, just the same fact in background

2025-11-19 06-14-01
Miguel Verdasca

Hi André,

This is expected behaviour and not actually a bug.

Why Swagger shows “double” for Decimal in OutSystems

OpenAPI/Swagger does not have a first-class “decimal” type. In the OpenAPI specification, all numeric types fall under:

type: numberformat: float | double

Since OutSystems Decimal is a high-precision numeric type and Swagger needs to map it to one of the available formats, it chooses double, which is the closest match available in OpenAPI.

So, what you’re seeing is simply a limitation of the Swagger/OpenAPI type system, not an error in OutSystems.

Does this affect API behaviour? No. Even though Swagger displays double, OutSystems will still parse and handle the value as a high-precision Decimal internally. The conversion only affects the documentation, not the runtime behaviour.

If you need Swagger to explicitly show a different format You can override it using the OpenAPI extension attributes and define a custom format such as:

type: numberformat: decimal

However, tools that consume Swagger might ignore the custom format since it’s not standard.


Let me sumup to you:

  • OutSystems Decimal → Swagger “double” (because Swagger has no decimal type)

  • Runtime precision is preserved

  • Documentation mapping only

  • Custom format is possible but not widely supported

Hope this clarifies it!

Best regards, Miguel


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.