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

Commit 5bcac34

Browse files
committed
Fix propertyNames example in draft-06 release notes
1 parent 6a9dee9 commit 5bcac34

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

draft-06/json-schema-release-notes.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ The difficulty is that if you attempt to do this:
7070
{
7171
"type": "object",
7272
"allOf": [
73-
{"$ref": "#/definitions/foo"},
74-
{"$ref": "#/definitions/bar"}
73+
{ "$ref": "#/definitions/foo" },
74+
{ "$ref": "#/definitions/bar" }
7575
],
7676
"definitions": {
7777
"foo": {
7878
"properties": {
79-
"foo": {"type": "string"}
79+
"foo": { "type": "string" }
8080
},
8181
"additionalProperties": false
8282
},
8383
"bar": {
8484
"properties": {
85-
"bar": {"type": "number"}
85+
"bar": { "type": "number" }
8686
},
8787
"additionalProperties": false
8888
}
@@ -100,30 +100,28 @@ A workaround is available with the new `"propertyNames"` keyword:
100100
{
101101
"type": "object",
102102
"allOf": [
103-
{"$ref": "#/definitions/foo"},
104-
{"$ref": "#/definitions/bar"}
105-
],
106-
"anyOf": [
107-
{"$ref": "#/definitions/fooNames"},
108-
{"$ref": "#/definitions/barNames"}
103+
{ "$ref": "#/definitions/foo" },
104+
{ "$ref": "#/definitions/bar" }
109105
],
106+
"propertyNames": {
107+
"anyOf": [
108+
{ "$ref": "#/definitions/fooNames" },
109+
{ "$ref": "#/definitions/barNames" }
110+
]
111+
},
110112
"definitions": {
111113
"foo": {
112114
"properties": {
113-
"foo": {"type": "string"}
115+
"foo": { "type": "string" }
114116
}
115117
},
116-
"fooNames": {
117-
"propertyNames": {"enum": ["foo"]}
118-
},
118+
"fooNames": { "enum": ["foo"] },
119119
"bar": {
120120
"properties": {
121-
"bar": {"type": "number"}
121+
"bar": { "type": "number" }
122122
}
123123
},
124-
"barNames": {
125-
"propertyNames": {"enum": ["bar"]}
126-
}
124+
"barNames": { "enum": ["bar"] }
127125
}
128126
}
129127
```

0 commit comments

Comments
 (0)