From aa651dee1d09dbca3c13a719a89f42d3cd9d7f87 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sat, 1 Aug 2020 17:35:52 +0000 Subject: [PATCH 1/2] The JSON schema specification states the format keyword can be used for any data type, not just primitive types --- versions/3.1.0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/3.1.0.md b/versions/3.1.0.md index 27921a9a75..7a47a8a1cd 100644 --- a/versions/3.1.0.md +++ b/versions/3.1.0.md @@ -139,11 +139,11 @@ It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `op ### Data Types -Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Draft 2019-09](http://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.4.2). +Data types in the OAS are based on the types supported by the [JSON Schema Specification Draft 2019-09](http://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.4.2). Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part. Models are defined using the [Schema Object](#schemaObject), which is a superset of JSON Schema Specification Draft 2019-09. -Primitives have an optional modifier property: `format`, which is defined by JSON Schema. +Data types can have an optional modifier property: `format`, which is defined by JSON Schema. OAS uses several known additional formats to define in fine detail the data type being used. However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value. Additional formats MAY be used even though undefined by either JSON Schema or this specification. From 18b8813211913ed4237b2601f149016869119cb0 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sat, 1 Aug 2020 18:01:20 +0000 Subject: [PATCH 2/2] The JSON schema specification states the format keyword can be used for any data type, not just primitive types --- versions/3.1.0.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/versions/3.1.0.md b/versions/3.1.0.md index 7a47a8a1cd..23dca9cd5a 100644 --- a/versions/3.1.0.md +++ b/versions/3.1.0.md @@ -143,13 +143,8 @@ Data types in the OAS are based on the types supported by the [JSON Schema Speci Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part. Models are defined using the [Schema Object](#schemaObject), which is a superset of JSON Schema Specification Draft 2019-09. -Data types can have an optional modifier property: `format`, which is defined by JSON Schema. -OAS uses several known additional formats to define in fine detail the data type being used. -However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value. -Additional formats MAY be used even though undefined by either JSON Schema or this specification. -Types that are not accompanied by a `format` property follow the type definition in the JSON Schema. Tools that do not recognize a specific `format` MAY default back to the `type` alone, as if the `format` is not specified. - -Note that by default, JSON Schema validators will not attempt to validate the `format` keyword. https://json-schema.org/draft/2019-09/release-notes.html#format-vocabulary +As defined by JSON Schema, data types can have an optional modifier property: `format`. +OAS defines additional formats to provide fine detail for primitive data types. The formats defined by the OAS are: