OpenAPI Data Types Reference

OpenAPI 3.1 data types, formats and JSON Schema primitives in one searchable table

Searchable reference for OpenAPI 3.1 type and format combinations — string formats like date-time, uuid, email; number formats float/double; integer int32/int64 — including nullable semantics and the JSON Schema alignment in 3.1.

What changed about data types in OpenAPI 3.1?

OpenAPI 3.1 is fully aligned with JSON Schema 2020-12. The standalone nullable keyword from 3.0 is removed; instead you express null with a type array such as type: [string, null]. The type keyword can also be a list, and exclusiveMinimum/Maximum became numbers rather than booleans.

OpenAPI describes the shape of API data using JSON Schema’s primitive types (string, number, integer, boolean, array, object, null) refined by an optional format keyword. Choosing the right type/format pair makes generated clients, server stubs and documentation accurate. This reference lists the common combinations and their semantics.

How it works

Every schema in an OpenAPI document has a type. For scalar types a format narrows the meaning — for example type: string, format: date-time means an RFC 3339 timestamp, and type: integer, format: int64 means a 64-bit integer. Tooling uses these to pick the right language type (e.g. OffsetDateTime, UUID, long) when generating code. In OpenAPI 3.1, schemas are pure JSON Schema 2020-12, so null is expressed with type arrays rather than the old nullable keyword.

Nullable in 3.0 vs 3.1

# OpenAPI 3.0
nickname:
  type: string
  nullable: true

# OpenAPI 3.1 (JSON Schema 2020-12)
nickname:
  type: [string, "null"]

Notes and tips

Treat format as a hint: many validators ignore formats they do not recognise, so add explicit constraints (pattern, minimum, maxLength) when correctness matters. Because JSON and JavaScript cannot represent the full int64 range safely, large identifiers are often modelled as type: string even though they are numeric. Custom formats are allowed and simply pass through as documentation.