Skip to content

Commit

Permalink
fix: clarify support for Boolean JSON Schemas (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Jun 15, 2021
1 parent ab5b63f commit f30dccf
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions spec/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1509,8 +1509,7 @@ components:
#### <a name="schemaObject"></a>Schema Object

The Schema Object allows the definition of input and output data types.
These types can be objects, but also primitives and arrays.
This object is a superset of the [JSON Schema Specification Draft 07](http://json-schema.org/).
These types can be objects, but also primitives and arrays. This object is a superset of the [JSON Schema Specification Draft 07](http://json-schema.org/). The empty schema (which allows any instance to validate) MAY be represented by the `boolean` value `true` and a schema which allows no instance to validate MAY be represented by the `boolean` value `false`.

Further information about the properties can be found in [JSON Schema Core](https://tools.ietf.org/html/draft-handrews-json-schema-01) and [JSON Schema Validation](https://tools.ietf.org/html/draft-handrews-json-schema-validation-01).
Unless stated otherwise, the property definitions follow the JSON Schema specification as referenced here.
Expand Down Expand Up @@ -1718,6 +1717,30 @@ example:
id: 1
```

###### Model with Boolean Schemas

```json
{
"type": "object",
"required": [
"anySchema"
],
"properties": {
"anySchema": true,
"cannotBeDefined": false
}
}
```

```yaml
type: object
required:
- anySchema
properties:
anySchema: true
cannotBeDefined: false
```

###### Models with Composition

```json
Expand Down

0 comments on commit f30dccf

Please sign in to comment.