Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Fix propertyNames example in draft-06 release notes #375

Merged
merged 1 commit into from
Feb 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions draft-06/json-schema-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ The difficulty is that if you attempt to do this:
{
"type": "object",
"allOf": [
{"$ref": "#/definitions/foo"},
{"$ref": "#/definitions/bar"}
{ "$ref": "#/definitions/foo" },
{ "$ref": "#/definitions/bar" }
],
"definitions": {
"foo": {
"properties": {
"foo": {"type": "string"}
"foo": { "type": "string" }
},
"additionalProperties": false
},
"bar": {
"properties": {
"bar": {"type": "number"}
"bar": { "type": "number" }
},
"additionalProperties": false
}
Expand All @@ -100,30 +100,28 @@ A workaround is available with the new `"propertyNames"` keyword:
{
"type": "object",
"allOf": [
{"$ref": "#/definitions/foo"},
{"$ref": "#/definitions/bar"}
],
"anyOf": [
{"$ref": "#/definitions/fooNames"},
{"$ref": "#/definitions/barNames"}
{ "$ref": "#/definitions/foo" },
{ "$ref": "#/definitions/bar" }
],
"propertyNames": {
"anyOf": [
{ "$ref": "#/definitions/fooNames" },
{ "$ref": "#/definitions/barNames" }
]
},
"definitions": {
"foo": {
"properties": {
"foo": {"type": "string"}
"foo": { "type": "string" }
}
},
"fooNames": {
"propertyNames": {"enum": ["foo"]}
},
"fooNames": { "enum": ["foo"] },
"bar": {
"properties": {
"bar": {"type": "number"}
"bar": { "type": "number" }
}
},
"barNames": {
"propertyNames": {"enum": ["bar"]}
}
"barNames": { "enum": ["bar"] }
}
}
```
Expand Down