Structural validation alone may be insufficient to validate that an instance meets all the
requirements of an application. The "format" keyword is defined to allow interoperable
semantic validation for a fixed subset of values which are accurately described by
authoritative resources, be they RFCs or other external specifications.
The value of this keyword is called a format attribute. It MUST be a string. A format
attribute can generally only validate a given set of instance types. If the type of the
instance to validate is not in this set, validation for this format attribute and instance
SHOULD succeed.
See Data Type Formats for further
details. While relying on JSON Schema's defined formats, the OAS offers a few additional
predefined formats.
Example values when "type" is "integer" include: "int32", "int64".
Example values when "type" is "number" include: "float", "double".
Example values when "type" is "string" include: "date", "date-time", "password".
Structural validation alone may be insufficient to validate that an instance meets all the requirements of an application. The "format" keyword is defined to allow interoperable semantic validation for a fixed subset of values which are accurately described by authoritative resources, be they RFCs or other external specifications.
The value of this keyword is called a format attribute. It MUST be a string. A format attribute can generally only validate a given set of instance types. If the type of the instance to validate is not in this set, validation for this format attribute and instance SHOULD succeed.
See Data Type Formats for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
Example values when "type" is "integer" include: "int32", "int64". Example values when "type" is "number" include: "float", "double". Example values when "type" is "string" include: "date", "date-time", "password".